using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using C1.Win.C1Input;
using C1.Win.C1TrueDBGrid;
using PCSComSale.Order.BO;
using PCSComSale.Order.DS;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.MasterSetup.DS;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;
using CancelEventArgs = System.ComponentModel.CancelEventArgs;
using PCSComUtils.DataContext;
using PCSComUtils.MasterSetup.BO;

namespace PCSSale.Order
{
    /// <summary>
    /// Summary description for SOAdditionCharges.
    /// </summary>
    public class SOAdditionCharges : Form
    {
        #region controls

        private Button btnSave;
        private Button btnDelete;
        private RadioButton radManual;
        private RadioButton radByPrice;
        private RadioButton radByQuantity;
        private Button btnToDistribute;
        private Label lblDistributionAmount;
        private GroupBox grbDistribution;
        private Button btnClose;
        private Button btnHelp;
        private C1TrueDBGrid dgrdData;
        private Label lblLabelTotalAmount;
        private Label lblLabelTotalNetAmount;
        private Label lblLabelTotalVATAmount;
        private Label lblLabelCustomerName;
        private Label lblLabelCustomerNo;
        private Label lblLabelSONumber;
        private Label lbLabelOrderDate;
        private Label lblLabelCCN;
        private Label lblSONumber;
        private Label lblOrderDate;
        private Label lblCustomerName;
        private Label lblCustomerNo;
        private Label lblTotalVATAmount;
        private Label lblTotalNetAmount;
        private Label lblTotalAmount;
        private Label lblCCN;
        private C1NumericEdit txtDistributionAmount;

        #endregion

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private Container components = null;

        private const string THIS = "PCSSale.Order.SOAdditionCharges";
        private const string LINE_COL = "Line";
        private const int DECIMAL_ROUND = 5;
        private const int VAT_NUMBER = 100;
        private const string NOT_EQUAL = "<>";
        private const string BY_PRICE = "BYPRICE";
        private const string BY_MANUAL = "BYMANUAL";
        private const string BY_QUANTITY = "BYQUANTITY";

        private EnumAction mEnumAction;

        public EnumAction enumAction
        {
            get { return mEnumAction; }
            set { mEnumAction = value; }
        }

        private int intSaleOrderMasterID;
        private SOAdditionChargesBO boSOAdditionCharges = new SOAdditionChargesBO();
        private DataSet dstData = new DataSet();
        private SO_SaleOrderMasterVO voSOMaster;
        private SO_SaleOrderDetail voSODetail;
        private MST_AddChargeVO voAddCharge;
        private MST_ReasonVO voReason;
        private string strSelectedValue;
        private bool blnChargeByQuantity;
        private DataTable tblSODetail = new DataTable(SO_SaleOrderDetailTable.TABLE_NAME);
        private UtilsBO boUtils;
        private System.Windows.Forms.TextBox txtCellValue;
        private int intDeletedLine;

        //**************************************************************************              
        ///    <Description>
        ///       Default constructor
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        public SOAdditionCharges()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        //**************************************************************************              
        ///    <Description>
        ///       Parameterise constructor
        ///    </Description>
        ///    <Inputs>
        ///        int: SaleOrderMasterID
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    17-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        public SOAdditionCharges(int pintSaleOrderMasterID)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            intSaleOrderMasterID = pintSaleOrderMasterID;
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SOAdditionCharges));
            this.lblLabelTotalAmount = new System.Windows.Forms.Label();
            this.lblLabelTotalNetAmount = new System.Windows.Forms.Label();
            this.lblLabelTotalVATAmount = new System.Windows.Forms.Label();
            this.grbDistribution = new System.Windows.Forms.GroupBox();
            this.txtDistributionAmount = new C1.Win.C1Input.C1NumericEdit();
            this.radManual = new System.Windows.Forms.RadioButton();
            this.radByPrice = new System.Windows.Forms.RadioButton();
            this.radByQuantity = new System.Windows.Forms.RadioButton();
            this.btnToDistribute = new System.Windows.Forms.Button();
            this.lblDistributionAmount = new System.Windows.Forms.Label();
            this.lblLabelCustomerName = new System.Windows.Forms.Label();
            this.lblLabelCustomerNo = new System.Windows.Forms.Label();
            this.lblLabelSONumber = new System.Windows.Forms.Label();
            this.lbLabelOrderDate = new System.Windows.Forms.Label();
            this.lblLabelCCN = new System.Windows.Forms.Label();
            this.btnDelete = new System.Windows.Forms.Button();
            this.btnSave = new System.Windows.Forms.Button();
            this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.btnClose = new System.Windows.Forms.Button();
            this.btnHelp = new System.Windows.Forms.Button();
            this.lblSONumber = new System.Windows.Forms.Label();
            this.lblOrderDate = new System.Windows.Forms.Label();
            this.lblCustomerName = new System.Windows.Forms.Label();
            this.lblCustomerNo = new System.Windows.Forms.Label();
            this.lblTotalVATAmount = new System.Windows.Forms.Label();
            this.lblTotalNetAmount = new System.Windows.Forms.Label();
            this.lblTotalAmount = new System.Windows.Forms.Label();
            this.lblCCN = new System.Windows.Forms.Label();
            this.txtCellValue = new System.Windows.Forms.TextBox();
            this.grbDistribution.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtDistributionAmount)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
            this.SuspendLayout();
            // 
            // lblLabelTotalAmount
            // 
            this.lblLabelTotalAmount.AccessibleDescription = resources.GetString("lblLabelTotalAmount.AccessibleDescription");
            this.lblLabelTotalAmount.AccessibleName = resources.GetString("lblLabelTotalAmount.AccessibleName");
            this.lblLabelTotalAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelTotalAmount.Anchor")));
            this.lblLabelTotalAmount.AutoSize = ((bool)(resources.GetObject("lblLabelTotalAmount.AutoSize")));
            this.lblLabelTotalAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelTotalAmount.Dock")));
            this.lblLabelTotalAmount.Enabled = ((bool)(resources.GetObject("lblLabelTotalAmount.Enabled")));
            this.lblLabelTotalAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelTotalAmount.Font")));
            this.lblLabelTotalAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelTotalAmount.Image")));
            this.lblLabelTotalAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalAmount.ImageAlign")));
            this.lblLabelTotalAmount.ImageIndex = ((int)(resources.GetObject("lblLabelTotalAmount.ImageIndex")));
            this.lblLabelTotalAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelTotalAmount.ImeMode")));
            this.lblLabelTotalAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelTotalAmount.Location")));
            this.lblLabelTotalAmount.Name = "lblLabelTotalAmount";
            this.lblLabelTotalAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelTotalAmount.RightToLeft")));
            this.lblLabelTotalAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelTotalAmount.Size")));
            this.lblLabelTotalAmount.TabIndex = ((int)(resources.GetObject("lblLabelTotalAmount.TabIndex")));
            this.lblLabelTotalAmount.Text = resources.GetString("lblLabelTotalAmount.Text");
            this.lblLabelTotalAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalAmount.TextAlign")));
            this.lblLabelTotalAmount.Visible = ((bool)(resources.GetObject("lblLabelTotalAmount.Visible")));
            // 
            // lblLabelTotalNetAmount
            // 
            this.lblLabelTotalNetAmount.AccessibleDescription = resources.GetString("lblLabelTotalNetAmount.AccessibleDescription");
            this.lblLabelTotalNetAmount.AccessibleName = resources.GetString("lblLabelTotalNetAmount.AccessibleName");
            this.lblLabelTotalNetAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelTotalNetAmount.Anchor")));
            this.lblLabelTotalNetAmount.AutoSize = ((bool)(resources.GetObject("lblLabelTotalNetAmount.AutoSize")));
            this.lblLabelTotalNetAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelTotalNetAmount.Dock")));
            this.lblLabelTotalNetAmount.Enabled = ((bool)(resources.GetObject("lblLabelTotalNetAmount.Enabled")));
            this.lblLabelTotalNetAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelTotalNetAmount.Font")));
            this.lblLabelTotalNetAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelTotalNetAmount.Image")));
            this.lblLabelTotalNetAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalNetAmount.ImageAlign")));
            this.lblLabelTotalNetAmount.ImageIndex = ((int)(resources.GetObject("lblLabelTotalNetAmount.ImageIndex")));
            this.lblLabelTotalNetAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelTotalNetAmount.ImeMode")));
            this.lblLabelTotalNetAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelTotalNetAmount.Location")));
            this.lblLabelTotalNetAmount.Name = "lblLabelTotalNetAmount";
            this.lblLabelTotalNetAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelTotalNetAmount.RightToLeft")));
            this.lblLabelTotalNetAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelTotalNetAmount.Size")));
            this.lblLabelTotalNetAmount.TabIndex = ((int)(resources.GetObject("lblLabelTotalNetAmount.TabIndex")));
            this.lblLabelTotalNetAmount.Text = resources.GetString("lblLabelTotalNetAmount.Text");
            this.lblLabelTotalNetAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalNetAmount.TextAlign")));
            this.lblLabelTotalNetAmount.Visible = ((bool)(resources.GetObject("lblLabelTotalNetAmount.Visible")));
            // 
            // lblLabelTotalVATAmount
            // 
            this.lblLabelTotalVATAmount.AccessibleDescription = resources.GetString("lblLabelTotalVATAmount.AccessibleDescription");
            this.lblLabelTotalVATAmount.AccessibleName = resources.GetString("lblLabelTotalVATAmount.AccessibleName");
            this.lblLabelTotalVATAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelTotalVATAmount.Anchor")));
            this.lblLabelTotalVATAmount.AutoSize = ((bool)(resources.GetObject("lblLabelTotalVATAmount.AutoSize")));
            this.lblLabelTotalVATAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelTotalVATAmount.Dock")));
            this.lblLabelTotalVATAmount.Enabled = ((bool)(resources.GetObject("lblLabelTotalVATAmount.Enabled")));
            this.lblLabelTotalVATAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelTotalVATAmount.Font")));
            this.lblLabelTotalVATAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelTotalVATAmount.Image")));
            this.lblLabelTotalVATAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalVATAmount.ImageAlign")));
            this.lblLabelTotalVATAmount.ImageIndex = ((int)(resources.GetObject("lblLabelTotalVATAmount.ImageIndex")));
            this.lblLabelTotalVATAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelTotalVATAmount.ImeMode")));
            this.lblLabelTotalVATAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelTotalVATAmount.Location")));
            this.lblLabelTotalVATAmount.Name = "lblLabelTotalVATAmount";
            this.lblLabelTotalVATAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelTotalVATAmount.RightToLeft")));
            this.lblLabelTotalVATAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelTotalVATAmount.Size")));
            this.lblLabelTotalVATAmount.TabIndex = ((int)(resources.GetObject("lblLabelTotalVATAmount.TabIndex")));
            this.lblLabelTotalVATAmount.Text = resources.GetString("lblLabelTotalVATAmount.Text");
            this.lblLabelTotalVATAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelTotalVATAmount.TextAlign")));
            this.lblLabelTotalVATAmount.Visible = ((bool)(resources.GetObject("lblLabelTotalVATAmount.Visible")));
            // 
            // grbDistribution
            // 
            this.grbDistribution.AccessibleDescription = resources.GetString("grbDistribution.AccessibleDescription");
            this.grbDistribution.AccessibleName = resources.GetString("grbDistribution.AccessibleName");
            this.grbDistribution.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("grbDistribution.Anchor")));
            this.grbDistribution.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grbDistribution.BackgroundImage")));
            this.grbDistribution.Controls.Add(this.txtDistributionAmount);
            this.grbDistribution.Controls.Add(this.radManual);
            this.grbDistribution.Controls.Add(this.radByPrice);
            this.grbDistribution.Controls.Add(this.radByQuantity);
            this.grbDistribution.Controls.Add(this.btnToDistribute);
            this.grbDistribution.Controls.Add(this.lblDistributionAmount);
            this.grbDistribution.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("grbDistribution.Dock")));
            this.grbDistribution.Enabled = ((bool)(resources.GetObject("grbDistribution.Enabled")));
            this.grbDistribution.Font = ((System.Drawing.Font)(resources.GetObject("grbDistribution.Font")));
            this.grbDistribution.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("grbDistribution.ImeMode")));
            this.grbDistribution.Location = ((System.Drawing.Point)(resources.GetObject("grbDistribution.Location")));
            this.grbDistribution.Name = "grbDistribution";
            this.grbDistribution.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("grbDistribution.RightToLeft")));
            this.grbDistribution.Size = ((System.Drawing.Size)(resources.GetObject("grbDistribution.Size")));
            this.grbDistribution.TabIndex = ((int)(resources.GetObject("grbDistribution.TabIndex")));
            this.grbDistribution.TabStop = false;
            this.grbDistribution.Text = resources.GetString("grbDistribution.Text");
            this.grbDistribution.Visible = ((bool)(resources.GetObject("grbDistribution.Visible")));
            // 
            // txtDistributionAmount
            // 
            this.txtDistributionAmount.AcceptsEscape = ((bool)(resources.GetObject("txtDistributionAmount.AcceptsEscape")));
            this.txtDistributionAmount.AccessibleDescription = resources.GetString("txtDistributionAmount.AccessibleDescription");
            this.txtDistributionAmount.AccessibleName = resources.GetString("txtDistributionAmount.AccessibleName");
            this.txtDistributionAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtDistributionAmount.Anchor")));
            this.txtDistributionAmount.AutoSize = ((bool)(resources.GetObject("txtDistributionAmount.AutoSize")));
            this.txtDistributionAmount.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtDistributionAmount.BackgroundImage")));
            this.txtDistributionAmount.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("txtDistributionAmount.BorderStyle")));
            // 
            // txtDistributionAmount.Calculator
            // 
            this.txtDistributionAmount.Calculator.AccessibleDescription = resources.GetString("txtDistributionAmount.Calculator.AccessibleDescription");
            this.txtDistributionAmount.Calculator.AccessibleName = resources.GetString("txtDistributionAmount.Calculator.AccessibleName");
            this.txtDistributionAmount.Calculator.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtDistributionAmount.Calculator.BackgroundImage")));
            this.txtDistributionAmount.Calculator.ButtonFlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("txtDistributionAmount.Calculator.ButtonFlatStyle")));
            this.txtDistributionAmount.Calculator.DisplayFormat = resources.GetString("txtDistributionAmount.Calculator.DisplayFormat");
            this.txtDistributionAmount.Calculator.Font = ((System.Drawing.Font)(resources.GetObject("txtDistributionAmount.Calculator.Font")));
            this.txtDistributionAmount.Calculator.FormatOnClose = ((bool)(resources.GetObject("txtDistributionAmount.Calculator.FormatOnClose")));
            this.txtDistributionAmount.Calculator.StoredFormat = resources.GetString("txtDistributionAmount.Calculator.StoredFormat");
            this.txtDistributionAmount.Calculator.UIStrings.Content = ((string[])(resources.GetObject("txtDistributionAmount.Calculator.UIStrings.Content")));
            this.txtDistributionAmount.CaseSensitive = ((bool)(resources.GetObject("txtDistributionAmount.CaseSensitive")));
            this.txtDistributionAmount.Culture = ((int)(resources.GetObject("txtDistributionAmount.Culture")));
            this.txtDistributionAmount.CustomFormat = resources.GetString("txtDistributionAmount.CustomFormat");
            this.txtDistributionAmount.DataType = ((System.Type)(resources.GetObject("txtDistributionAmount.DataType")));
            this.txtDistributionAmount.DisableOnNoData = false;
            this.txtDistributionAmount.DisplayFormat.CustomFormat = resources.GetString("txtDistributionAmount.DisplayFormat.CustomFormat");
            this.txtDistributionAmount.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtDistributionAmount.DisplayFormat.FormatType")));
            this.txtDistributionAmount.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtDistributionAmount.DisplayFormat.Inherit")));
            this.txtDistributionAmount.DisplayFormat.NullText = resources.GetString("txtDistributionAmount.DisplayFormat.NullText");
            this.txtDistributionAmount.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("txtDistributionAmount.DisplayFormat.TrimEnd")));
            this.txtDistributionAmount.DisplayFormat.TrimStart = ((bool)(resources.GetObject("txtDistributionAmount.DisplayFormat.TrimStart")));
            this.txtDistributionAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtDistributionAmount.Dock")));
            this.txtDistributionAmount.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("txtDistributionAmount.DropDownFormAlign")));
            this.txtDistributionAmount.EditFormat.CustomFormat = resources.GetString("txtDistributionAmount.EditFormat.CustomFormat");
            this.txtDistributionAmount.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtDistributionAmount.EditFormat.FormatType")));
            this.txtDistributionAmount.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtDistributionAmount.EditFormat.Inherit")));
            this.txtDistributionAmount.EditFormat.NullText = resources.GetString("txtDistributionAmount.EditFormat.NullText");
            this.txtDistributionAmount.EditFormat.TrimEnd = ((bool)(resources.GetObject("txtDistributionAmount.EditFormat.TrimEnd")));
            this.txtDistributionAmount.EditFormat.TrimStart = ((bool)(resources.GetObject("txtDistributionAmount.EditFormat.TrimStart")));
            this.txtDistributionAmount.EditMask = resources.GetString("txtDistributionAmount.EditMask");
            this.txtDistributionAmount.EmptyAsNull = ((bool)(resources.GetObject("txtDistributionAmount.EmptyAsNull")));
            this.txtDistributionAmount.Enabled = ((bool)(resources.GetObject("txtDistributionAmount.Enabled")));
            this.txtDistributionAmount.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("txtDistributionAmount.ErrorInfo.BeepOnError")));
            this.txtDistributionAmount.ErrorInfo.ErrorMessage = resources.GetString("txtDistributionAmount.ErrorInfo.ErrorMessage");
            this.txtDistributionAmount.ErrorInfo.ErrorMessageCaption = resources.GetString("txtDistributionAmount.ErrorInfo.ErrorMessageCaption");
            this.txtDistributionAmount.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("txtDistributionAmount.ErrorInfo.ShowErrorMessage")));
            this.txtDistributionAmount.ErrorInfo.ValueOnError = ((object)(resources.GetObject("txtDistributionAmount.ErrorInfo.ValueOnError")));
            this.txtDistributionAmount.Font = ((System.Drawing.Font)(resources.GetObject("txtDistributionAmount.Font")));
            this.txtDistributionAmount.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtDistributionAmount.FormatType")));
            this.txtDistributionAmount.GapHeight = ((int)(resources.GetObject("txtDistributionAmount.GapHeight")));
            this.txtDistributionAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtDistributionAmount.ImeMode")));
            this.txtDistributionAmount.Increment = ((object)(resources.GetObject("txtDistributionAmount.Increment")));
            this.txtDistributionAmount.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("txtDistributionAmount.InitialSelection")));
            this.txtDistributionAmount.Location = ((System.Drawing.Point)(resources.GetObject("txtDistributionAmount.Location")));
            this.txtDistributionAmount.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("txtDistributionAmount.MaskInfo.AutoTabWhenFilled")));
            this.txtDistributionAmount.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("txtDistributionAmount.MaskInfo.CaseSensitive")));
            this.txtDistributionAmount.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("txtDistributionAmount.MaskInfo.CopyWithLiterals")));
            this.txtDistributionAmount.MaskInfo.EditMask = resources.GetString("txtDistributionAmount.MaskInfo.EditMask");
            this.txtDistributionAmount.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("txtDistributionAmount.MaskInfo.EmptyAsNull")));
            this.txtDistributionAmount.MaskInfo.ErrorMessage = resources.GetString("txtDistributionAmount.MaskInfo.ErrorMessage");
            this.txtDistributionAmount.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("txtDistributionAmount.MaskInfo.Inherit")));
            this.txtDistributionAmount.MaskInfo.PromptChar = ((char)(resources.GetObject("txtDistributionAmount.MaskInfo.PromptChar")));
            this.txtDistributionAmount.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("txtDistributionAmount.MaskInfo.ShowLiterals")));
            this.txtDistributionAmount.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("txtDistributionAmount.MaskInfo.StoredEmptyChar")));
            this.txtDistributionAmount.MaxLength = ((int)(resources.GetObject("txtDistributionAmount.MaxLength")));
            this.txtDistributionAmount.Name = "txtDistributionAmount";
            this.txtDistributionAmount.NullText = resources.GetString("txtDistributionAmount.NullText");
            this.txtDistributionAmount.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("txtDistributionAmount.ParseInfo.CaseSensitive")));
            this.txtDistributionAmount.ParseInfo.CustomFormat = resources.GetString("txtDistributionAmount.ParseInfo.CustomFormat");
            this.txtDistributionAmount.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("txtDistributionAmount.ParseInfo.EmptyAsNull")));
            this.txtDistributionAmount.ParseInfo.ErrorMessage = resources.GetString("txtDistributionAmount.ParseInfo.ErrorMessage");
            this.txtDistributionAmount.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtDistributionAmount.ParseInfo.FormatType")));
            this.txtDistributionAmount.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("txtDistributionAmount.ParseInfo.Inherit")));
            this.txtDistributionAmount.ParseInfo.NullText = resources.GetString("txtDistributionAmount.ParseInfo.NullText");
            this.txtDistributionAmount.ParseInfo.NumberStyle = ((C1.Win.C1Input.NumberStyleFlags)(resources.GetObject("txtDistributionAmount.ParseInfo.NumberStyle")));
            this.txtDistributionAmount.ParseInfo.TrimEnd = ((bool)(resources.GetObject("txtDistributionAmount.ParseInfo.TrimEnd")));
            this.txtDistributionAmount.ParseInfo.TrimStart = ((bool)(resources.GetObject("txtDistributionAmount.ParseInfo.TrimStart")));
            this.txtDistributionAmount.PasswordChar = ((char)(resources.GetObject("txtDistributionAmount.PasswordChar")));
            this.txtDistributionAmount.PostValidation.CaseSensitive = ((bool)(resources.GetObject("txtDistributionAmount.PostValidation.CaseSensitive")));
            this.txtDistributionAmount.PostValidation.ErrorMessage = resources.GetString("txtDistributionAmount.PostValidation.ErrorMessage");
            this.txtDistributionAmount.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("txtDistributionAmount.PostValidation.Inherit")));
            this.txtDistributionAmount.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("txtDistributionAmount.PostValidation.Validation")));
            this.txtDistributionAmount.PostValidation.Values = ((System.Array)(resources.GetObject("txtDistributionAmount.PostValidation.Values")));
            this.txtDistributionAmount.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("txtDistributionAmount.PostValidation.ValuesExcluded")));
            this.txtDistributionAmount.PreValidation.CaseSensitive = ((bool)(resources.GetObject("txtDistributionAmount.PreValidation.CaseSensitive")));
            this.txtDistributionAmount.PreValidation.ErrorMessage = resources.GetString("txtDistributionAmount.PreValidation.ErrorMessage");
            this.txtDistributionAmount.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("txtDistributionAmount.PreValidation.Inherit")));
            this.txtDistributionAmount.PreValidation.ItemSeparator = resources.GetString("txtDistributionAmount.PreValidation.ItemSeparator");
            this.txtDistributionAmount.PreValidation.PatternString = resources.GetString("txtDistributionAmount.PreValidation.PatternString");
            this.txtDistributionAmount.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("txtDistributionAmount.PreValidation.RegexOptions")));
            this.txtDistributionAmount.PreValidation.TrimEnd = ((bool)(resources.GetObject("txtDistributionAmount.PreValidation.TrimEnd")));
            this.txtDistributionAmount.PreValidation.TrimStart = ((bool)(resources.GetObject("txtDistributionAmount.PreValidation.TrimStart")));
            this.txtDistributionAmount.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("txtDistributionAmount.PreValidation.Validation")));
            this.txtDistributionAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtDistributionAmount.RightToLeft")));
            this.txtDistributionAmount.ShowFocusRectangle = ((bool)(resources.GetObject("txtDistributionAmount.ShowFocusRectangle")));
            this.txtDistributionAmount.Size = ((System.Drawing.Size)(resources.GetObject("txtDistributionAmount.Size")));
            this.txtDistributionAmount.TabIndex = ((int)(resources.GetObject("txtDistributionAmount.TabIndex")));
            this.txtDistributionAmount.Tag = ((object)(resources.GetObject("txtDistributionAmount.Tag")));
            this.txtDistributionAmount.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtDistributionAmount.TextAlign")));
            this.txtDistributionAmount.TrimEnd = ((bool)(resources.GetObject("txtDistributionAmount.TrimEnd")));
            this.txtDistributionAmount.TrimStart = ((bool)(resources.GetObject("txtDistributionAmount.TrimStart")));
            this.txtDistributionAmount.UserCultureOverride = ((bool)(resources.GetObject("txtDistributionAmount.UserCultureOverride")));
            this.txtDistributionAmount.Value = ((object)(resources.GetObject("txtDistributionAmount.Value")));
            this.txtDistributionAmount.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("txtDistributionAmount.VerticalAlign")));
            this.txtDistributionAmount.Visible = ((bool)(resources.GetObject("txtDistributionAmount.Visible")));
            this.txtDistributionAmount.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("txtDistributionAmount.VisibleButtons")));
            this.txtDistributionAmount.Enter += new System.EventHandler(this.txtDistributionAmount_Enter);
            this.txtDistributionAmount.Leave += new System.EventHandler(this.txtDistributionAmount_Leave);
            // 
            // radManual
            // 
            this.radManual.AccessibleDescription = resources.GetString("radManual.AccessibleDescription");
            this.radManual.AccessibleName = resources.GetString("radManual.AccessibleName");
            this.radManual.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radManual.Anchor")));
            this.radManual.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radManual.Appearance")));
            this.radManual.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radManual.BackgroundImage")));
            this.radManual.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radManual.CheckAlign")));
            this.radManual.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radManual.Dock")));
            this.radManual.Enabled = ((bool)(resources.GetObject("radManual.Enabled")));
            this.radManual.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radManual.FlatStyle")));
            this.radManual.Font = ((System.Drawing.Font)(resources.GetObject("radManual.Font")));
            this.radManual.Image = ((System.Drawing.Image)(resources.GetObject("radManual.Image")));
            this.radManual.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radManual.ImageAlign")));
            this.radManual.ImageIndex = ((int)(resources.GetObject("radManual.ImageIndex")));
            this.radManual.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radManual.ImeMode")));
            this.radManual.Location = ((System.Drawing.Point)(resources.GetObject("radManual.Location")));
            this.radManual.Name = "radManual";
            this.radManual.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radManual.RightToLeft")));
            this.radManual.Size = ((System.Drawing.Size)(resources.GetObject("radManual.Size")));
            this.radManual.TabIndex = ((int)(resources.GetObject("radManual.TabIndex")));
            this.radManual.Text = resources.GetString("radManual.Text");
            this.radManual.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radManual.TextAlign")));
            this.radManual.Visible = ((bool)(resources.GetObject("radManual.Visible")));
            this.radManual.CheckedChanged += new System.EventHandler(this.radManual_CheckedChanged);
            // 
            // radByPrice
            // 
            this.radByPrice.AccessibleDescription = resources.GetString("radByPrice.AccessibleDescription");
            this.radByPrice.AccessibleName = resources.GetString("radByPrice.AccessibleName");
            this.radByPrice.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radByPrice.Anchor")));
            this.radByPrice.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radByPrice.Appearance")));
            this.radByPrice.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radByPrice.BackgroundImage")));
            this.radByPrice.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPrice.CheckAlign")));
            this.radByPrice.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radByPrice.Dock")));
            this.radByPrice.Enabled = ((bool)(resources.GetObject("radByPrice.Enabled")));
            this.radByPrice.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radByPrice.FlatStyle")));
            this.radByPrice.Font = ((System.Drawing.Font)(resources.GetObject("radByPrice.Font")));
            this.radByPrice.Image = ((System.Drawing.Image)(resources.GetObject("radByPrice.Image")));
            this.radByPrice.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPrice.ImageAlign")));
            this.radByPrice.ImageIndex = ((int)(resources.GetObject("radByPrice.ImageIndex")));
            this.radByPrice.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radByPrice.ImeMode")));
            this.radByPrice.Location = ((System.Drawing.Point)(resources.GetObject("radByPrice.Location")));
            this.radByPrice.Name = "radByPrice";
            this.radByPrice.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radByPrice.RightToLeft")));
            this.radByPrice.Size = ((System.Drawing.Size)(resources.GetObject("radByPrice.Size")));
            this.radByPrice.TabIndex = ((int)(resources.GetObject("radByPrice.TabIndex")));
            this.radByPrice.Text = resources.GetString("radByPrice.Text");
            this.radByPrice.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPrice.TextAlign")));
            this.radByPrice.Visible = ((bool)(resources.GetObject("radByPrice.Visible")));
            this.radByPrice.CheckedChanged += new System.EventHandler(this.radByPrice_CheckedChanged);
            // 
            // radByQuantity
            // 
            this.radByQuantity.AccessibleDescription = resources.GetString("radByQuantity.AccessibleDescription");
            this.radByQuantity.AccessibleName = resources.GetString("radByQuantity.AccessibleName");
            this.radByQuantity.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radByQuantity.Anchor")));
            this.radByQuantity.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radByQuantity.Appearance")));
            this.radByQuantity.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radByQuantity.BackgroundImage")));
            this.radByQuantity.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByQuantity.CheckAlign")));
            this.radByQuantity.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radByQuantity.Dock")));
            this.radByQuantity.Enabled = ((bool)(resources.GetObject("radByQuantity.Enabled")));
            this.radByQuantity.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radByQuantity.FlatStyle")));
            this.radByQuantity.Font = ((System.Drawing.Font)(resources.GetObject("radByQuantity.Font")));
            this.radByQuantity.Image = ((System.Drawing.Image)(resources.GetObject("radByQuantity.Image")));
            this.radByQuantity.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByQuantity.ImageAlign")));
            this.radByQuantity.ImageIndex = ((int)(resources.GetObject("radByQuantity.ImageIndex")));
            this.radByQuantity.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radByQuantity.ImeMode")));
            this.radByQuantity.Location = ((System.Drawing.Point)(resources.GetObject("radByQuantity.Location")));
            this.radByQuantity.Name = "radByQuantity";
            this.radByQuantity.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radByQuantity.RightToLeft")));
            this.radByQuantity.Size = ((System.Drawing.Size)(resources.GetObject("radByQuantity.Size")));
            this.radByQuantity.TabIndex = ((int)(resources.GetObject("radByQuantity.TabIndex")));
            this.radByQuantity.Text = resources.GetString("radByQuantity.Text");
            this.radByQuantity.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByQuantity.TextAlign")));
            this.radByQuantity.Visible = ((bool)(resources.GetObject("radByQuantity.Visible")));
            this.radByQuantity.CheckedChanged += new System.EventHandler(this.radByQuantity_CheckedChanged);
            // 
            // btnToDistribute
            // 
            this.btnToDistribute.AccessibleDescription = resources.GetString("btnToDistribute.AccessibleDescription");
            this.btnToDistribute.AccessibleName = resources.GetString("btnToDistribute.AccessibleName");
            this.btnToDistribute.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnToDistribute.Anchor")));
            this.btnToDistribute.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnToDistribute.BackgroundImage")));
            this.btnToDistribute.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnToDistribute.Dock")));
            this.btnToDistribute.Enabled = ((bool)(resources.GetObject("btnToDistribute.Enabled")));
            this.btnToDistribute.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnToDistribute.FlatStyle")));
            this.btnToDistribute.Font = ((System.Drawing.Font)(resources.GetObject("btnToDistribute.Font")));
            this.btnToDistribute.Image = ((System.Drawing.Image)(resources.GetObject("btnToDistribute.Image")));
            this.btnToDistribute.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnToDistribute.ImageAlign")));
            this.btnToDistribute.ImageIndex = ((int)(resources.GetObject("btnToDistribute.ImageIndex")));
            this.btnToDistribute.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnToDistribute.ImeMode")));
            this.btnToDistribute.Location = ((System.Drawing.Point)(resources.GetObject("btnToDistribute.Location")));
            this.btnToDistribute.Name = "btnToDistribute";
            this.btnToDistribute.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnToDistribute.RightToLeft")));
            this.btnToDistribute.Size = ((System.Drawing.Size)(resources.GetObject("btnToDistribute.Size")));
            this.btnToDistribute.TabIndex = ((int)(resources.GetObject("btnToDistribute.TabIndex")));
            this.btnToDistribute.Text = resources.GetString("btnToDistribute.Text");
            this.btnToDistribute.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnToDistribute.TextAlign")));
            this.btnToDistribute.Visible = ((bool)(resources.GetObject("btnToDistribute.Visible")));
            this.btnToDistribute.Click += new System.EventHandler(this.btnToDistribute_Click);
            // 
            // lblDistributionAmount
            // 
            this.lblDistributionAmount.AccessibleDescription = resources.GetString("lblDistributionAmount.AccessibleDescription");
            this.lblDistributionAmount.AccessibleName = resources.GetString("lblDistributionAmount.AccessibleName");
            this.lblDistributionAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblDistributionAmount.Anchor")));
            this.lblDistributionAmount.AutoSize = ((bool)(resources.GetObject("lblDistributionAmount.AutoSize")));
            this.lblDistributionAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblDistributionAmount.Dock")));
            this.lblDistributionAmount.Enabled = ((bool)(resources.GetObject("lblDistributionAmount.Enabled")));
            this.lblDistributionAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblDistributionAmount.Font")));
            this.lblDistributionAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblDistributionAmount.Image")));
            this.lblDistributionAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDistributionAmount.ImageAlign")));
            this.lblDistributionAmount.ImageIndex = ((int)(resources.GetObject("lblDistributionAmount.ImageIndex")));
            this.lblDistributionAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblDistributionAmount.ImeMode")));
            this.lblDistributionAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblDistributionAmount.Location")));
            this.lblDistributionAmount.Name = "lblDistributionAmount";
            this.lblDistributionAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblDistributionAmount.RightToLeft")));
            this.lblDistributionAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblDistributionAmount.Size")));
            this.lblDistributionAmount.TabIndex = ((int)(resources.GetObject("lblDistributionAmount.TabIndex")));
            this.lblDistributionAmount.Text = resources.GetString("lblDistributionAmount.Text");
            this.lblDistributionAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDistributionAmount.TextAlign")));
            this.lblDistributionAmount.Visible = ((bool)(resources.GetObject("lblDistributionAmount.Visible")));
            // 
            // lblLabelCustomerName
            // 
            this.lblLabelCustomerName.AccessibleDescription = resources.GetString("lblLabelCustomerName.AccessibleDescription");
            this.lblLabelCustomerName.AccessibleName = resources.GetString("lblLabelCustomerName.AccessibleName");
            this.lblLabelCustomerName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelCustomerName.Anchor")));
            this.lblLabelCustomerName.AutoSize = ((bool)(resources.GetObject("lblLabelCustomerName.AutoSize")));
            this.lblLabelCustomerName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelCustomerName.Dock")));
            this.lblLabelCustomerName.Enabled = ((bool)(resources.GetObject("lblLabelCustomerName.Enabled")));
            this.lblLabelCustomerName.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelCustomerName.Font")));
            this.lblLabelCustomerName.ForeColor = System.Drawing.SystemColors.ControlText;
            this.lblLabelCustomerName.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelCustomerName.Image")));
            this.lblLabelCustomerName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCustomerName.ImageAlign")));
            this.lblLabelCustomerName.ImageIndex = ((int)(resources.GetObject("lblLabelCustomerName.ImageIndex")));
            this.lblLabelCustomerName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelCustomerName.ImeMode")));
            this.lblLabelCustomerName.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelCustomerName.Location")));
            this.lblLabelCustomerName.Name = "lblLabelCustomerName";
            this.lblLabelCustomerName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelCustomerName.RightToLeft")));
            this.lblLabelCustomerName.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelCustomerName.Size")));
            this.lblLabelCustomerName.TabIndex = ((int)(resources.GetObject("lblLabelCustomerName.TabIndex")));
            this.lblLabelCustomerName.Text = resources.GetString("lblLabelCustomerName.Text");
            this.lblLabelCustomerName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCustomerName.TextAlign")));
            this.lblLabelCustomerName.Visible = ((bool)(resources.GetObject("lblLabelCustomerName.Visible")));
            // 
            // lblLabelCustomerNo
            // 
            this.lblLabelCustomerNo.AccessibleDescription = resources.GetString("lblLabelCustomerNo.AccessibleDescription");
            this.lblLabelCustomerNo.AccessibleName = resources.GetString("lblLabelCustomerNo.AccessibleName");
            this.lblLabelCustomerNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelCustomerNo.Anchor")));
            this.lblLabelCustomerNo.AutoSize = ((bool)(resources.GetObject("lblLabelCustomerNo.AutoSize")));
            this.lblLabelCustomerNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelCustomerNo.Dock")));
            this.lblLabelCustomerNo.Enabled = ((bool)(resources.GetObject("lblLabelCustomerNo.Enabled")));
            this.lblLabelCustomerNo.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelCustomerNo.Font")));
            this.lblLabelCustomerNo.ForeColor = System.Drawing.SystemColors.ControlText;
            this.lblLabelCustomerNo.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelCustomerNo.Image")));
            this.lblLabelCustomerNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCustomerNo.ImageAlign")));
            this.lblLabelCustomerNo.ImageIndex = ((int)(resources.GetObject("lblLabelCustomerNo.ImageIndex")));
            this.lblLabelCustomerNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelCustomerNo.ImeMode")));
            this.lblLabelCustomerNo.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelCustomerNo.Location")));
            this.lblLabelCustomerNo.Name = "lblLabelCustomerNo";
            this.lblLabelCustomerNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelCustomerNo.RightToLeft")));
            this.lblLabelCustomerNo.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelCustomerNo.Size")));
            this.lblLabelCustomerNo.TabIndex = ((int)(resources.GetObject("lblLabelCustomerNo.TabIndex")));
            this.lblLabelCustomerNo.Text = resources.GetString("lblLabelCustomerNo.Text");
            this.lblLabelCustomerNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCustomerNo.TextAlign")));
            this.lblLabelCustomerNo.Visible = ((bool)(resources.GetObject("lblLabelCustomerNo.Visible")));
            // 
            // lblLabelSONumber
            // 
            this.lblLabelSONumber.AccessibleDescription = resources.GetString("lblLabelSONumber.AccessibleDescription");
            this.lblLabelSONumber.AccessibleName = resources.GetString("lblLabelSONumber.AccessibleName");
            this.lblLabelSONumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelSONumber.Anchor")));
            this.lblLabelSONumber.AutoSize = ((bool)(resources.GetObject("lblLabelSONumber.AutoSize")));
            this.lblLabelSONumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelSONumber.Dock")));
            this.lblLabelSONumber.Enabled = ((bool)(resources.GetObject("lblLabelSONumber.Enabled")));
            this.lblLabelSONumber.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelSONumber.Font")));
            this.lblLabelSONumber.ForeColor = System.Drawing.SystemColors.ControlText;
            this.lblLabelSONumber.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelSONumber.Image")));
            this.lblLabelSONumber.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelSONumber.ImageAlign")));
            this.lblLabelSONumber.ImageIndex = ((int)(resources.GetObject("lblLabelSONumber.ImageIndex")));
            this.lblLabelSONumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelSONumber.ImeMode")));
            this.lblLabelSONumber.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelSONumber.Location")));
            this.lblLabelSONumber.Name = "lblLabelSONumber";
            this.lblLabelSONumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelSONumber.RightToLeft")));
            this.lblLabelSONumber.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelSONumber.Size")));
            this.lblLabelSONumber.TabIndex = ((int)(resources.GetObject("lblLabelSONumber.TabIndex")));
            this.lblLabelSONumber.Text = resources.GetString("lblLabelSONumber.Text");
            this.lblLabelSONumber.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelSONumber.TextAlign")));
            this.lblLabelSONumber.Visible = ((bool)(resources.GetObject("lblLabelSONumber.Visible")));
            // 
            // lbLabelOrderDate
            // 
            this.lbLabelOrderDate.AccessibleDescription = resources.GetString("lbLabelOrderDate.AccessibleDescription");
            this.lbLabelOrderDate.AccessibleName = resources.GetString("lbLabelOrderDate.AccessibleName");
            this.lbLabelOrderDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lbLabelOrderDate.Anchor")));
            this.lbLabelOrderDate.AutoSize = ((bool)(resources.GetObject("lbLabelOrderDate.AutoSize")));
            this.lbLabelOrderDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lbLabelOrderDate.Dock")));
            this.lbLabelOrderDate.Enabled = ((bool)(resources.GetObject("lbLabelOrderDate.Enabled")));
            this.lbLabelOrderDate.Font = ((System.Drawing.Font)(resources.GetObject("lbLabelOrderDate.Font")));
            this.lbLabelOrderDate.ForeColor = System.Drawing.SystemColors.ControlText;
            this.lbLabelOrderDate.Image = ((System.Drawing.Image)(resources.GetObject("lbLabelOrderDate.Image")));
            this.lbLabelOrderDate.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lbLabelOrderDate.ImageAlign")));
            this.lbLabelOrderDate.ImageIndex = ((int)(resources.GetObject("lbLabelOrderDate.ImageIndex")));
            this.lbLabelOrderDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lbLabelOrderDate.ImeMode")));
            this.lbLabelOrderDate.Location = ((System.Drawing.Point)(resources.GetObject("lbLabelOrderDate.Location")));
            this.lbLabelOrderDate.Name = "lbLabelOrderDate";
            this.lbLabelOrderDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lbLabelOrderDate.RightToLeft")));
            this.lbLabelOrderDate.Size = ((System.Drawing.Size)(resources.GetObject("lbLabelOrderDate.Size")));
            this.lbLabelOrderDate.TabIndex = ((int)(resources.GetObject("lbLabelOrderDate.TabIndex")));
            this.lbLabelOrderDate.Text = resources.GetString("lbLabelOrderDate.Text");
            this.lbLabelOrderDate.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lbLabelOrderDate.TextAlign")));
            this.lbLabelOrderDate.Visible = ((bool)(resources.GetObject("lbLabelOrderDate.Visible")));
            // 
            // lblLabelCCN
            // 
            this.lblLabelCCN.AccessibleDescription = resources.GetString("lblLabelCCN.AccessibleDescription");
            this.lblLabelCCN.AccessibleName = resources.GetString("lblLabelCCN.AccessibleName");
            this.lblLabelCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelCCN.Anchor")));
            this.lblLabelCCN.AutoSize = ((bool)(resources.GetObject("lblLabelCCN.AutoSize")));
            this.lblLabelCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelCCN.Dock")));
            this.lblLabelCCN.Enabled = ((bool)(resources.GetObject("lblLabelCCN.Enabled")));
            this.lblLabelCCN.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelCCN.Font")));
            this.lblLabelCCN.ForeColor = System.Drawing.SystemColors.ControlText;
            this.lblLabelCCN.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelCCN.Image")));
            this.lblLabelCCN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCCN.ImageAlign")));
            this.lblLabelCCN.ImageIndex = ((int)(resources.GetObject("lblLabelCCN.ImageIndex")));
            this.lblLabelCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelCCN.ImeMode")));
            this.lblLabelCCN.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelCCN.Location")));
            this.lblLabelCCN.Name = "lblLabelCCN";
            this.lblLabelCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelCCN.RightToLeft")));
            this.lblLabelCCN.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelCCN.Size")));
            this.lblLabelCCN.TabIndex = ((int)(resources.GetObject("lblLabelCCN.TabIndex")));
            this.lblLabelCCN.Text = resources.GetString("lblLabelCCN.Text");
            this.lblLabelCCN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelCCN.TextAlign")));
            this.lblLabelCCN.Visible = ((bool)(resources.GetObject("lblLabelCCN.Visible")));
            // 
            // btnDelete
            // 
            this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
            this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
            this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
            this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
            this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
            this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
            this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
            this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
            this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
            this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
            this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
            this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
            this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
            this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
            this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
            this.btnDelete.Text = resources.GetString("btnDelete.Text");
            this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
            this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
            this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
            // 
            // btnSave
            // 
            this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
            this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
            this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
            this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
            this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
            this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
            this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
            this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
            this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
            this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
            this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
            this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
            this.btnSave.Name = "btnSave";
            this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
            this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
            this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
            this.btnSave.Text = resources.GetString("btnSave.Text");
            this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
            this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // dgrdData
            // 
            this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
            this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
            this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
            this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
            this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
            this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
            this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
            this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
            this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
            this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
            this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
            this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
            this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
            this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
            this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
            this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
            this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
            this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
            this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
            this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
            this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
            this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
            this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
            this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
            this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
            this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
            this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
            this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
            this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
            this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
            this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
            this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
            this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
            this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
            this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
            this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
            this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
            this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
            this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
            this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
            this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
            this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
            this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
            this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
            this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
            this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.dgrdData.Name = "dgrdData";
            this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
            this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
            this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
            this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
            this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
            this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
            this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
            this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
            this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
            this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
            this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
            this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
            this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
            this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
            this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
            this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
            this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
            this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
            this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
            this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
            this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
            this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
            this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
            this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
            this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
            this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
            this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
            this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
            this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
            this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
            this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
            this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
            this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
            this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
            this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
            this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
            this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
            this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
            this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
            this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
            this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
            this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
            this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
            this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
            this.dgrdData.Text = resources.GetString("dgrdData.Text");
            this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
            this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
            this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
            this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
            this.dgrdData.AfterDelete += new System.EventHandler(this.dgrdData_AfterDelete);
            this.dgrdData.BeforeColEdit += new C1.Win.C1TrueDBGrid.BeforeColEditEventHandler(this.dgrdData_BeforeColEdit);
            this.dgrdData.ButtonClick += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_ButtonClick);
            this.dgrdData.AfterColUpdate += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColUpdate);
            this.dgrdData.BeforeDelete += new C1.Win.C1TrueDBGrid.CancelEventHandler(this.dgrdData_BeforeDelete);
            this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
            this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
            // 
            // btnClose
            // 
            this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
            this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
            this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
            this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
            this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
            this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
            this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
            this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
            this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
            this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
            this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
            this.btnClose.Name = "btnClose";
            this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
            this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
            this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
            this.btnClose.Text = resources.GetString("btnClose.Text");
            this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
            this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            // 
            // btnHelp
            // 
            this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
            this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
            this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
            this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
            this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
            this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
            this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
            this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
            this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
            this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
            this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
            this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
            this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
            this.btnHelp.Name = "btnHelp";
            this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
            this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
            this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
            this.btnHelp.Text = resources.GetString("btnHelp.Text");
            this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
            this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
            this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
            // 
            // lblSONumber
            // 
            this.lblSONumber.AccessibleDescription = resources.GetString("lblSONumber.AccessibleDescription");
            this.lblSONumber.AccessibleName = resources.GetString("lblSONumber.AccessibleName");
            this.lblSONumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblSONumber.Anchor")));
            this.lblSONumber.AutoSize = ((bool)(resources.GetObject("lblSONumber.AutoSize")));
            this.lblSONumber.BackColor = System.Drawing.Color.White;
            this.lblSONumber.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblSONumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblSONumber.Dock")));
            this.lblSONumber.Enabled = ((bool)(resources.GetObject("lblSONumber.Enabled")));
            this.lblSONumber.Font = ((System.Drawing.Font)(resources.GetObject("lblSONumber.Font")));
            this.lblSONumber.ForeColor = System.Drawing.Color.Black;
            this.lblSONumber.Image = ((System.Drawing.Image)(resources.GetObject("lblSONumber.Image")));
            this.lblSONumber.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblSONumber.ImageAlign")));
            this.lblSONumber.ImageIndex = ((int)(resources.GetObject("lblSONumber.ImageIndex")));
            this.lblSONumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblSONumber.ImeMode")));
            this.lblSONumber.Location = ((System.Drawing.Point)(resources.GetObject("lblSONumber.Location")));
            this.lblSONumber.Name = "lblSONumber";
            this.lblSONumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblSONumber.RightToLeft")));
            this.lblSONumber.Size = ((System.Drawing.Size)(resources.GetObject("lblSONumber.Size")));
            this.lblSONumber.TabIndex = ((int)(resources.GetObject("lblSONumber.TabIndex")));
            this.lblSONumber.Text = resources.GetString("lblSONumber.Text");
            this.lblSONumber.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblSONumber.TextAlign")));
            this.lblSONumber.Visible = ((bool)(resources.GetObject("lblSONumber.Visible")));
            // 
            // lblOrderDate
            // 
            this.lblOrderDate.AccessibleDescription = resources.GetString("lblOrderDate.AccessibleDescription");
            this.lblOrderDate.AccessibleName = resources.GetString("lblOrderDate.AccessibleName");
            this.lblOrderDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblOrderDate.Anchor")));
            this.lblOrderDate.AutoSize = ((bool)(resources.GetObject("lblOrderDate.AutoSize")));
            this.lblOrderDate.BackColor = System.Drawing.Color.White;
            this.lblOrderDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblOrderDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblOrderDate.Dock")));
            this.lblOrderDate.Enabled = ((bool)(resources.GetObject("lblOrderDate.Enabled")));
            this.lblOrderDate.Font = ((System.Drawing.Font)(resources.GetObject("lblOrderDate.Font")));
            this.lblOrderDate.ForeColor = System.Drawing.Color.Black;
            this.lblOrderDate.Image = ((System.Drawing.Image)(resources.GetObject("lblOrderDate.Image")));
            this.lblOrderDate.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblOrderDate.ImageAlign")));
            this.lblOrderDate.ImageIndex = ((int)(resources.GetObject("lblOrderDate.ImageIndex")));
            this.lblOrderDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblOrderDate.ImeMode")));
            this.lblOrderDate.Location = ((System.Drawing.Point)(resources.GetObject("lblOrderDate.Location")));
            this.lblOrderDate.Name = "lblOrderDate";
            this.lblOrderDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblOrderDate.RightToLeft")));
            this.lblOrderDate.Size = ((System.Drawing.Size)(resources.GetObject("lblOrderDate.Size")));
            this.lblOrderDate.TabIndex = ((int)(resources.GetObject("lblOrderDate.TabIndex")));
            this.lblOrderDate.Text = resources.GetString("lblOrderDate.Text");
            this.lblOrderDate.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblOrderDate.TextAlign")));
            this.lblOrderDate.Visible = ((bool)(resources.GetObject("lblOrderDate.Visible")));
            // 
            // lblCustomerName
            // 
            this.lblCustomerName.AccessibleDescription = resources.GetString("lblCustomerName.AccessibleDescription");
            this.lblCustomerName.AccessibleName = resources.GetString("lblCustomerName.AccessibleName");
            this.lblCustomerName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCustomerName.Anchor")));
            this.lblCustomerName.AutoSize = ((bool)(resources.GetObject("lblCustomerName.AutoSize")));
            this.lblCustomerName.BackColor = System.Drawing.Color.White;
            this.lblCustomerName.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblCustomerName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCustomerName.Dock")));
            this.lblCustomerName.Enabled = ((bool)(resources.GetObject("lblCustomerName.Enabled")));
            this.lblCustomerName.Font = ((System.Drawing.Font)(resources.GetObject("lblCustomerName.Font")));
            this.lblCustomerName.ForeColor = System.Drawing.Color.Black;
            this.lblCustomerName.Image = ((System.Drawing.Image)(resources.GetObject("lblCustomerName.Image")));
            this.lblCustomerName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCustomerName.ImageAlign")));
            this.lblCustomerName.ImageIndex = ((int)(resources.GetObject("lblCustomerName.ImageIndex")));
            this.lblCustomerName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCustomerName.ImeMode")));
            this.lblCustomerName.Location = ((System.Drawing.Point)(resources.GetObject("lblCustomerName.Location")));
            this.lblCustomerName.Name = "lblCustomerName";
            this.lblCustomerName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCustomerName.RightToLeft")));
            this.lblCustomerName.Size = ((System.Drawing.Size)(resources.GetObject("lblCustomerName.Size")));
            this.lblCustomerName.TabIndex = ((int)(resources.GetObject("lblCustomerName.TabIndex")));
            this.lblCustomerName.Text = resources.GetString("lblCustomerName.Text");
            this.lblCustomerName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCustomerName.TextAlign")));
            this.lblCustomerName.Visible = ((bool)(resources.GetObject("lblCustomerName.Visible")));
            // 
            // lblCustomerNo
            // 
            this.lblCustomerNo.AccessibleDescription = resources.GetString("lblCustomerNo.AccessibleDescription");
            this.lblCustomerNo.AccessibleName = resources.GetString("lblCustomerNo.AccessibleName");
            this.lblCustomerNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCustomerNo.Anchor")));
            this.lblCustomerNo.AutoSize = ((bool)(resources.GetObject("lblCustomerNo.AutoSize")));
            this.lblCustomerNo.BackColor = System.Drawing.Color.White;
            this.lblCustomerNo.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblCustomerNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCustomerNo.Dock")));
            this.lblCustomerNo.Enabled = ((bool)(resources.GetObject("lblCustomerNo.Enabled")));
            this.lblCustomerNo.Font = ((System.Drawing.Font)(resources.GetObject("lblCustomerNo.Font")));
            this.lblCustomerNo.ForeColor = System.Drawing.Color.Black;
            this.lblCustomerNo.Image = ((System.Drawing.Image)(resources.GetObject("lblCustomerNo.Image")));
            this.lblCustomerNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCustomerNo.ImageAlign")));
            this.lblCustomerNo.ImageIndex = ((int)(resources.GetObject("lblCustomerNo.ImageIndex")));
            this.lblCustomerNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCustomerNo.ImeMode")));
            this.lblCustomerNo.Location = ((System.Drawing.Point)(resources.GetObject("lblCustomerNo.Location")));
            this.lblCustomerNo.Name = "lblCustomerNo";
            this.lblCustomerNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCustomerNo.RightToLeft")));
            this.lblCustomerNo.Size = ((System.Drawing.Size)(resources.GetObject("lblCustomerNo.Size")));
            this.lblCustomerNo.TabIndex = ((int)(resources.GetObject("lblCustomerNo.TabIndex")));
            this.lblCustomerNo.Text = resources.GetString("lblCustomerNo.Text");
            this.lblCustomerNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCustomerNo.TextAlign")));
            this.lblCustomerNo.Visible = ((bool)(resources.GetObject("lblCustomerNo.Visible")));
            // 
            // lblTotalVATAmount
            // 
            this.lblTotalVATAmount.AccessibleDescription = resources.GetString("lblTotalVATAmount.AccessibleDescription");
            this.lblTotalVATAmount.AccessibleName = resources.GetString("lblTotalVATAmount.AccessibleName");
            this.lblTotalVATAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblTotalVATAmount.Anchor")));
            this.lblTotalVATAmount.AutoSize = ((bool)(resources.GetObject("lblTotalVATAmount.AutoSize")));
            this.lblTotalVATAmount.BackColor = System.Drawing.Color.White;
            this.lblTotalVATAmount.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblTotalVATAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblTotalVATAmount.Dock")));
            this.lblTotalVATAmount.Enabled = ((bool)(resources.GetObject("lblTotalVATAmount.Enabled")));
            this.lblTotalVATAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblTotalVATAmount.Font")));
            this.lblTotalVATAmount.ForeColor = System.Drawing.Color.Black;
            this.lblTotalVATAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblTotalVATAmount.Image")));
            this.lblTotalVATAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalVATAmount.ImageAlign")));
            this.lblTotalVATAmount.ImageIndex = ((int)(resources.GetObject("lblTotalVATAmount.ImageIndex")));
            this.lblTotalVATAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblTotalVATAmount.ImeMode")));
            this.lblTotalVATAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblTotalVATAmount.Location")));
            this.lblTotalVATAmount.Name = "lblTotalVATAmount";
            this.lblTotalVATAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblTotalVATAmount.RightToLeft")));
            this.lblTotalVATAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblTotalVATAmount.Size")));
            this.lblTotalVATAmount.TabIndex = ((int)(resources.GetObject("lblTotalVATAmount.TabIndex")));
            this.lblTotalVATAmount.Text = resources.GetString("lblTotalVATAmount.Text");
            this.lblTotalVATAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalVATAmount.TextAlign")));
            this.lblTotalVATAmount.Visible = ((bool)(resources.GetObject("lblTotalVATAmount.Visible")));
            // 
            // lblTotalNetAmount
            // 
            this.lblTotalNetAmount.AccessibleDescription = resources.GetString("lblTotalNetAmount.AccessibleDescription");
            this.lblTotalNetAmount.AccessibleName = resources.GetString("lblTotalNetAmount.AccessibleName");
            this.lblTotalNetAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblTotalNetAmount.Anchor")));
            this.lblTotalNetAmount.AutoSize = ((bool)(resources.GetObject("lblTotalNetAmount.AutoSize")));
            this.lblTotalNetAmount.BackColor = System.Drawing.Color.White;
            this.lblTotalNetAmount.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblTotalNetAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblTotalNetAmount.Dock")));
            this.lblTotalNetAmount.Enabled = ((bool)(resources.GetObject("lblTotalNetAmount.Enabled")));
            this.lblTotalNetAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblTotalNetAmount.Font")));
            this.lblTotalNetAmount.ForeColor = System.Drawing.Color.Black;
            this.lblTotalNetAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblTotalNetAmount.Image")));
            this.lblTotalNetAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalNetAmount.ImageAlign")));
            this.lblTotalNetAmount.ImageIndex = ((int)(resources.GetObject("lblTotalNetAmount.ImageIndex")));
            this.lblTotalNetAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblTotalNetAmount.ImeMode")));
            this.lblTotalNetAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblTotalNetAmount.Location")));
            this.lblTotalNetAmount.Name = "lblTotalNetAmount";
            this.lblTotalNetAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblTotalNetAmount.RightToLeft")));
            this.lblTotalNetAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblTotalNetAmount.Size")));
            this.lblTotalNetAmount.TabIndex = ((int)(resources.GetObject("lblTotalNetAmount.TabIndex")));
            this.lblTotalNetAmount.Text = resources.GetString("lblTotalNetAmount.Text");
            this.lblTotalNetAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalNetAmount.TextAlign")));
            this.lblTotalNetAmount.Visible = ((bool)(resources.GetObject("lblTotalNetAmount.Visible")));
            // 
            // lblTotalAmount
            // 
            this.lblTotalAmount.AccessibleDescription = resources.GetString("lblTotalAmount.AccessibleDescription");
            this.lblTotalAmount.AccessibleName = resources.GetString("lblTotalAmount.AccessibleName");
            this.lblTotalAmount.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblTotalAmount.Anchor")));
            this.lblTotalAmount.AutoSize = ((bool)(resources.GetObject("lblTotalAmount.AutoSize")));
            this.lblTotalAmount.BackColor = System.Drawing.Color.White;
            this.lblTotalAmount.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblTotalAmount.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblTotalAmount.Dock")));
            this.lblTotalAmount.Enabled = ((bool)(resources.GetObject("lblTotalAmount.Enabled")));
            this.lblTotalAmount.Font = ((System.Drawing.Font)(resources.GetObject("lblTotalAmount.Font")));
            this.lblTotalAmount.ForeColor = System.Drawing.Color.Black;
            this.lblTotalAmount.Image = ((System.Drawing.Image)(resources.GetObject("lblTotalAmount.Image")));
            this.lblTotalAmount.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalAmount.ImageAlign")));
            this.lblTotalAmount.ImageIndex = ((int)(resources.GetObject("lblTotalAmount.ImageIndex")));
            this.lblTotalAmount.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblTotalAmount.ImeMode")));
            this.lblTotalAmount.Location = ((System.Drawing.Point)(resources.GetObject("lblTotalAmount.Location")));
            this.lblTotalAmount.Name = "lblTotalAmount";
            this.lblTotalAmount.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblTotalAmount.RightToLeft")));
            this.lblTotalAmount.Size = ((System.Drawing.Size)(resources.GetObject("lblTotalAmount.Size")));
            this.lblTotalAmount.TabIndex = ((int)(resources.GetObject("lblTotalAmount.TabIndex")));
            this.lblTotalAmount.Text = resources.GetString("lblTotalAmount.Text");
            this.lblTotalAmount.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTotalAmount.TextAlign")));
            this.lblTotalAmount.Visible = ((bool)(resources.GetObject("lblTotalAmount.Visible")));
            // 
            // lblCCN
            // 
            this.lblCCN.AccessibleDescription = resources.GetString("lblCCN.AccessibleDescription");
            this.lblCCN.AccessibleName = resources.GetString("lblCCN.AccessibleName");
            this.lblCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCCN.Anchor")));
            this.lblCCN.AutoSize = ((bool)(resources.GetObject("lblCCN.AutoSize")));
            this.lblCCN.BackColor = System.Drawing.Color.White;
            this.lblCCN.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCCN.Dock")));
            this.lblCCN.Enabled = ((bool)(resources.GetObject("lblCCN.Enabled")));
            this.lblCCN.Font = ((System.Drawing.Font)(resources.GetObject("lblCCN.Font")));
            this.lblCCN.ForeColor = System.Drawing.Color.Black;
            this.lblCCN.Image = ((System.Drawing.Image)(resources.GetObject("lblCCN.Image")));
            this.lblCCN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.ImageAlign")));
            this.lblCCN.ImageIndex = ((int)(resources.GetObject("lblCCN.ImageIndex")));
            this.lblCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCCN.ImeMode")));
            this.lblCCN.Location = ((System.Drawing.Point)(resources.GetObject("lblCCN.Location")));
            this.lblCCN.Name = "lblCCN";
            this.lblCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCCN.RightToLeft")));
            this.lblCCN.Size = ((System.Drawing.Size)(resources.GetObject("lblCCN.Size")));
            this.lblCCN.TabIndex = ((int)(resources.GetObject("lblCCN.TabIndex")));
            this.lblCCN.Text = resources.GetString("lblCCN.Text");
            this.lblCCN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.TextAlign")));
            this.lblCCN.Visible = ((bool)(resources.GetObject("lblCCN.Visible")));
            // 
            // txtCellValue
            // 
            this.txtCellValue.AccessibleDescription = resources.GetString("txtCellValue.AccessibleDescription");
            this.txtCellValue.AccessibleName = resources.GetString("txtCellValue.AccessibleName");
            this.txtCellValue.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCellValue.Anchor")));
            this.txtCellValue.AutoSize = ((bool)(resources.GetObject("txtCellValue.AutoSize")));
            this.txtCellValue.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCellValue.BackgroundImage")));
            this.txtCellValue.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtCellValue.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCellValue.Dock")));
            this.txtCellValue.Enabled = ((bool)(resources.GetObject("txtCellValue.Enabled")));
            this.txtCellValue.Font = ((System.Drawing.Font)(resources.GetObject("txtCellValue.Font")));
            this.txtCellValue.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCellValue.ImeMode")));
            this.txtCellValue.Location = ((System.Drawing.Point)(resources.GetObject("txtCellValue.Location")));
            this.txtCellValue.MaxLength = ((int)(resources.GetObject("txtCellValue.MaxLength")));
            this.txtCellValue.Multiline = ((bool)(resources.GetObject("txtCellValue.Multiline")));
            this.txtCellValue.Name = "txtCellValue";
            this.txtCellValue.PasswordChar = ((char)(resources.GetObject("txtCellValue.PasswordChar")));
            this.txtCellValue.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCellValue.RightToLeft")));
            this.txtCellValue.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCellValue.ScrollBars")));
            this.txtCellValue.Size = ((System.Drawing.Size)(resources.GetObject("txtCellValue.Size")));
            this.txtCellValue.TabIndex = ((int)(resources.GetObject("txtCellValue.TabIndex")));
            this.txtCellValue.Text = resources.GetString("txtCellValue.Text");
            this.txtCellValue.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCellValue.TextAlign")));
            this.txtCellValue.Visible = ((bool)(resources.GetObject("txtCellValue.Visible")));
            this.txtCellValue.WordWrap = ((bool)(resources.GetObject("txtCellValue.WordWrap")));
            // 
            // SOAdditionCharges
            // 
            this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
            this.AccessibleName = resources.GetString("$this.AccessibleName");
            this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
            this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
            this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
            this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.CancelButton = this.btnClose;
            this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
            this.Controls.Add(this.lblTotalAmount);
            this.Controls.Add(this.lblCCN);
            this.Controls.Add(this.lblTotalVATAmount);
            this.Controls.Add(this.lblTotalNetAmount);
            this.Controls.Add(this.lblCustomerName);
            this.Controls.Add(this.lblCustomerNo);
            this.Controls.Add(this.lblOrderDate);
            this.Controls.Add(this.lblSONumber);
            this.Controls.Add(this.dgrdData);
            this.Controls.Add(this.txtCellValue);
            this.Controls.Add(this.lblLabelTotalAmount);
            this.Controls.Add(this.lblLabelTotalNetAmount);
            this.Controls.Add(this.lblLabelTotalVATAmount);
            this.Controls.Add(this.grbDistribution);
            this.Controls.Add(this.lbLabelOrderDate);
            this.Controls.Add(this.lblLabelCCN);
            this.Controls.Add(this.lblLabelCustomerName);
            this.Controls.Add(this.lblLabelCustomerNo);
            this.Controls.Add(this.lblLabelSONumber);
            this.Controls.Add(this.btnDelete);
            this.Controls.Add(this.btnClose);
            this.Controls.Add(this.btnHelp);
            this.Controls.Add(this.btnSave);
            this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
            this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
            this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
            this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
            this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
            this.Name = "SOAdditionCharges";
            this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
            this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
            this.Text = resources.GetString("$this.Text");
            this.Closing += new System.ComponentModel.CancelEventHandler(this.SOAdditionCharges_Closing);
            this.Load += new System.EventHandler(this.SOAdditionCharges_Load);
            this.grbDistribution.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.txtDistributionAmount)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        #region Form events
        
        //**************************************************************************
        private void SOAdditionCharges_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".SOAdditionCharges_Load()";
            try
            {
                #region Apply security

                //Set authorization for user
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    return;
                }

                #endregion

                // initial value
                voSOMaster = new SO_SaleOrderMasterVO();
                voSODetail = new SO_SaleOrderDetail();
                voAddCharge = new MST_AddChargeVO();
                voReason = new MST_ReasonVO();
                boUtils = new UtilsBO();

                // get SOMasterVO
                voSOMaster = boSOAdditionCharges.GetSaleOrderMasterVOFromID(intSaleOrderMasterID);
                // determine if this master is charged or not
                if (boSOAdditionCharges.AlreadyCharged(intSaleOrderMasterID))
                    dstData = boSOAdditionCharges.GetAdditionalChargeBySOMasterID(intSaleOrderMasterID);
                else
                    dstData = boSOAdditionCharges.GetDataBySOMasterID(intSaleOrderMasterID);
                // assign default value to SaleOrderMasterID column
                dstData.Tables[0].Columns[SO_AdditionChargeTable.SALEORDERMASTERID_FLD].DefaultValue = intSaleOrderMasterID;
                // get list of so detail by current master
                tblSODetail = new SaleOrderBO().ListDetailByMaster(intSaleOrderMasterID).Tables[0];
                // assign default value fo SaleOrderMasterID
                tblSODetail.Columns[SO_AdditionChargeTable.SALEORDERMASTERID_FLD].DefaultValue = intSaleOrderMasterID;
                // get CCN code
                string strCCNCode = boSOAdditionCharges.GetCCNCodeFromID(voSOMaster.CCNID);
                // fill to label
                lblCCN.Text = strCCNCode;
                lblSONumber.Text = voSOMaster.Code;
                lblOrderDate.Text = voSOMaster.TransDate.ToString(Constants.DATETIME_FORMAT);
                // get customer information
                MST_Party voParty = new MST_Party();
                voParty = new PartyBO().GetParty(voSOMaster.PartyID,string.Empty);
                // fill to label
                lblCustomerNo.Text = voParty.Code;
                lblCustomerName.Text = voParty.Name;
                // bind data source for the true db grid
                BindDataToGrid();
                // update Total Amount, Total NET Amount, Total VAT Amount
                UpdateTotalAmount();
                // if all of product have the same UM then set radByQuantity = true
                blnChargeByQuantity = boSOAdditionCharges.IsChargeByQuantity(intSaleOrderMasterID);
                if (blnChargeByQuantity)
                {
                    radByQuantity.Checked = true;
                    //radByPrice.Enabled = false;
                }
                else
                {
                    radByPrice.Checked = true;
                    //radByQuantity.Enabled = false;
                }
                // format distribution amount text box
                txtDistributionAmount.FormatType = FormatTypeEnum.CustomFormat;
                txtDistributionAmount.CustomFormat = Constants.DECIMAL_NUMBERFORMAT;
                txtDistributionAmount.Focus();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnClose_Click(object sender, EventArgs e)
        {
            Close();
        }

        //**************************************************************************              
        ///    <Description>
        ///       - Save into Database and show success message
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnSave_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSave_Click()";
            try
            {
                // check mandatory field
                int intTotalRows = dgrdData.RowCount;
                if (mEnumAction != EnumAction.Edit)
                {
                    if (intTotalRows <= 0)
                        return;
                    for (int i = 0; i < intTotalRows; i++)
                    {
                        try
                        {
                            int.Parse(dgrdData[i, LINE_COL].ToString());
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Select();
                            return;
                        }
                        // sale order line
                        try
                        {
                            int.Parse(dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD].ToString());
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD]);
                            return;
                        }
                        // addition charge
                        try
                        {
                            int.Parse(dgrdData[i, SO_AdditionChargeTable.ADDCHARGEID_FLD].ToString());
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD]);
                            return;
                        }
                        // charge quantity
                        try
                        {
                            decimal decQuantity = decimal.Parse(dgrdData[i, SO_AdditionChargeTable.QUANTITY_FLD].ToString());
                            decimal decUnitPrice = decimal.Parse(dgrdData[i, SO_AdditionChargeTable.UNITPRICE_FLD].ToString());
                            decimal decAmount = decimal.Parse(dgrdData[i, SO_AdditionChargeTable.AMOUNT_FLD].ToString());
                            if ((decQuantity < 0) || (decUnitPrice < 0) || (decAmount < 0))
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_INPUT_NEGATIVE_NUMBER, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Row = i;
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD]);
                                return;
                            }
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD]);
                            return;
                        }
                    }
                }
                if (SaveData())
                {
                    // display success message
                    PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    // get data from database
                    dstData = boSOAdditionCharges.GetAdditionalChargeBySOMasterID(intSaleOrderMasterID);
                    // rebind to grid
                    BindDataToGrid();
                }
                else
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_SAVE_TO_DB, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnDelete_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDelete_Click()";
            if (dgrdData.RowCount == 0)
            {
                return;
            }
            // ask user to confirm delete
            DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
            if (dlgResult == DialogResult.Yes)
            {
                try
                {
                    int intRowCount = dgrdData.RowCount;
                    for (int i = intRowCount - 1; i >= 0; i--)
                    {
                        dstData.Tables[0].Rows[i].Delete();
                    }
                    dgrdData.UpdateData();
                    mEnumAction = EnumAction.Edit;
                    // turn allow AddNew on
                    dgrdData.AllowAddNew = true;
                    lblTotalNetAmount.Text = decimal.Zero.ToString();
                    lblTotalAmount.Text = decimal.Zero.ToString();
                    lblTotalVATAmount.Text = decimal.Zero.ToString();
                }
                catch (Exception ex)
                {
                    PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnHelp_Click(object sender, EventArgs e)
        {
        }

        //**************************************************************************              
        ///    <Description>
        ///       - Fill data for Line cell = last cell value + 1
        ///       - Fill SO Line = Line number in sales order
        ///       - If ByQuantity = True, 
        ///				fill Amount = Quantity/(total Quantity) * Distribution Amount 
        ///       - If ByPrice = True, 
        ///				fill Amount = Unit Price/(total Unit Price) * Distribution Amount
        ///       - Fill VAT Amount = Amount * 0.1 * VAT
        ///       - Fill Total Amount = Amount + VAT Amount
        ///       - Update Total Amount, Total VAT Amount, Total Net Amount
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void btnToDistribute_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnToDistribute_Click()";
            try
            {
                if (radByQuantity.Checked)
                    UpdateAmount(BY_QUANTITY, false);
                else if (radByPrice.Checked)
                    UpdateAmount(BY_PRICE, false);
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void radByPrice_CheckedChanged(object sender, EventArgs e)
        {
            /*
            if (blnChargeByQuantity)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_COULDNOT_CHARGE_BY_PRICE, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                radByPrice.Checked = false;
                return;
            }
            */
            // enable btnToDistribute
            btnToDistribute.Enabled = true;
        }

        //**************************************************************************              
        ///    <Description>
        ///       
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void radByQuantity_CheckedChanged(object sender, EventArgs e)
        {
            /*
            if (!blnChargeByQuantity)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_COULDNOT_CHARGE_BY_QUANTITY, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                radByQuantity.Checked = false;
                return;
            }
            */
            // enable btnToDistribute
            btnToDistribute.Enabled = true;
        }

        //**************************************************************************              
        ///    <Description>
        ///       - Clear all rows in dgrdData
        ///       - Disable btnToDistribute
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void radManual_CheckedChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radManual_CheckedChanged()";
            try
            {
                /*
                    // clear all rows in grid data
                    dstData.Tables[0].Clear();
                    // allow grid to add new row
                    dgrdData.AllowAddNew = true;
                    lblTotalNetAmount.Text = decimal.Zero.ToString();
                    lblTotalAmount.Text = decimal.Zero.ToString();
                    lblTotalVATAmount.Text = decimal.Zero.ToString();
                    // disable btnToDistribute
                */
                btnToDistribute.Enabled = false;
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     If KeyDown = F12
        ///       - Add new blank row
        ///       - Fill data for Line cell = last cell value + 1
        ///       - Amount = distribution amount - sum(amount)
        ///       - Set focus to SO Line
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_KeyDown(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_KeyDown()";
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.F12:
                        if (dgrdData.AllowAddNew)
                        {
                            dgrdData.Row = dgrdData.RowCount;
                            // set grid to EditActive mode
                            dgrdData.EditActive = true;
                            // line number
                            int intMaxLine = 0;
                            if (dgrdData[dgrdData.Row, LINE_COL].ToString() == string.Empty)
                            {
                                // get max line number
                                if (dgrdData.Row > 0)
                                {
                                    intMaxLine = int.Parse(dgrdData[dgrdData.Row - 1, LINE_COL].ToString());
                                }
                                dgrdData[dgrdData.Row, LINE_COL] = ++intMaxLine;
                            }
                            // sale order master id
                            dgrdData[dgrdData.Row, SO_AdditionChargeTable.SALEORDERMASTERID_FLD] = intSaleOrderMasterID;
                            decimal decDistributionAmount = 0;
                            decimal decSumAmount = CalculateTotalNETAmount();
                            try
                            {
                                decDistributionAmount = decimal.Parse(txtDistributionAmount.Text.Trim());
                                if (decDistributionAmount <= 0)
                                {
                                    PCSMessageBox.Show(ErrorCode.MESSAGE_DISTRIBUTE_AMOUNT_MUST_GREATER_THAN_ZERO, MessageBoxIcon.Error);
                                    txtDistributionAmount.Focus();
                                    txtDistributionAmount.SelectAll();
                                    return;
                                }
                            }
                            catch
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxIcon.Error);
                                txtDistributionAmount.Focus();
                                txtDistributionAmount.SelectAll();
                                return;
                            }
                            if (decDistributionAmount <= decSumAmount)
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_DISTRIBUTE_AMOUNT_MUST_GREATER_THAN_SUM_AMOUNT, MessageBoxIcon.Error);
                                txtDistributionAmount.Focus();
                                txtDistributionAmount.SelectAll();
                                return;
                            }
                            // amount = distribution amount - sum (amount)
                            dgrdData[dgrdData.Row, SO_AdditionChargeTable.AMOUNT_FLD] = decDistributionAmount - decSumAmount;
                            // set focus to SO Line
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD]);

                            // if total row have data of grid equal to number of sale order detail
                            // then disable add new record to grid
                            int intTotalRowHaveData = dgrdData.RowCount;
                            int intTotalSODetail = tblSODetail.Rows.Count;
                            if (intTotalRowHaveData == intTotalSODetail)
                            {
                                dgrdData.AllowAddNew = false;
                            }
                        }
                        break;
                    case Keys.F4:
                        // open search form
                        dgrdData_ButtonClick(null, null);
                        break;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     fill quantity, unit price when user select an item from SO Line
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    22-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_AfterColUpdate(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";
            try
            {
                string strSelectedColumn = dgrdData.Columns[dgrdData.Col].DataField;
                decimal decSelectedValue = 0;
                if (!strSelectedColumn.Equals(SO_SaleOrderDetailTable.SALEORDERLINE_FLD) && !strSelectedColumn.Equals(MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD)
                    && !strSelectedColumn.Equals(MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD))
                {
                    try
                    {
                        decSelectedValue = decimal.Parse(dgrdData[dgrdData.Row, dgrdData.Col].ToString());
                        if (decSelectedValue < 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_INPUT_NEGATIVE_NUMBER, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData[dgrdData.Row, dgrdData.Col] = strSelectedValue;
                            dgrdData.Row = dgrdData.Row;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD]);
                            return;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData[dgrdData.Row, e.ColIndex] = strSelectedValue;
                        dgrdData.Row = dgrdData.Row;
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD]);
                        return;
                    }
                }
                switch (strSelectedColumn)
                {
                    case SO_AdditionChargeTable.QUANTITY_FLD:
                    case SO_AdditionChargeTable.UNITPRICE_FLD:
                        //						if (strSelectedColumn == SO_AdditionChargeTable.QUANTITY_FLD)
                        //						{
                        //							// charge quantity must less than order quantity
                        //							decimal decOrderQuantity = boSOAdditionCharges.GetOrderQuantity(int.Parse(dgrdData[dgrdData.Row, SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD].ToString()));
                        //							if (decSelectedValue > decOrderQuantity)
                        //							{
                        //								PCSMessageBox.Show(ErrorCode.MESSAGE_CHARGEQTY_MUST_LESS_THAN_ORDERQTY, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //								dgrdData.Select();
                        //								dgrdData[dgrdData.Row, dgrdData.Col] = strSelectedValue;
                        //								return;
                        //							}
                        //						}
                        // update amount on grid
                        if (radByPrice.Checked)
                            UpdateAmount(BY_PRICE, true);
                        else if (radByQuantity.Checked)
                            UpdateAmount(BY_QUANTITY, true);
                        else if (radManual.Checked)
                            UpdateAmount(BY_MANUAL, true);
                        break;
                    case SO_AdditionChargeTable.AMOUNT_FLD:
                        // get AddChargeID
                        if ((dgrdData[dgrdData.Row, SO_AdditionChargeTable.ADDCHARGEID_FLD].ToString().Trim() != string.Empty) &&
                            (dgrdData[dgrdData.Row, SO_AdditionChargeTable.ADDCHARGEID_FLD] != null))
                        {
                            // get addition charge vo
                            voAddCharge = (MST_AddChargeVO)boSOAdditionCharges.GetAddCharge(int.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.ADDCHARGEID_FLD].ToString()));
                        }
                        else
                        {
                            PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Focus();
                            dgrdData.Select();
                            return;
                        }
                        //decAmount
                        dgrdData[dgrdData.Row, SO_AdditionChargeTable.VATAMOUNT_FLD] = Math.Round(decSelectedValue * voAddCharge.VAT / VAT_NUMBER, DECIMAL_ROUND);
                        dgrdData[dgrdData.Row, SO_AdditionChargeTable.TOTALAMOUNT_FLD] = Math.Round(decSelectedValue + decimal.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.VATAMOUNT_FLD].ToString()), DECIMAL_ROUND);
                        // update TotalAmount, TotalVATAmount, TotalNETAmount;
                        UpdateTotalAmount();
                        break;
                    case SO_AdditionChargeTable.VATAMOUNT_FLD:
                        dgrdData[dgrdData.Row, SO_AdditionChargeTable.TOTALAMOUNT_FLD] = Math.Round(decSelectedValue + decimal.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.AMOUNT_FLD].ToString()), DECIMAL_ROUND);
                        // update TotalAmount, TotalVATAmount, TotalNETAmount;
                        UpdateTotalAmount();
                        break;
                    case SO_AdditionChargeTable.TOTALAMOUNT_FLD:
                        // update TotalAmount, TotalVATAmount, TotalNETAmount;
                        UpdateTotalAmount();
                        break;
                    // so line
                    case SO_SaleOrderDetailTable.SALEORDERLINE_FLD:
                    // addition charge
                    case MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD:
                    // reason
                    case MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD:
                        FillDataToGrid();
                        break;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     get the selected value and store to a variable in order to compare later
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    22-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_BeforeColEdit(object sender, BeforeColEditEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColEdit()";
            try
            {
                // get the selected value and store to a variable in order to compare later
                strSelectedValue = dgrdData[dgrdData.Row, e.ColIndex].ToString();
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       When user leave distribution amount textbox, check user input data
        ///       and make sure data is numeric
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void txtDistributionAmount_Leave(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtDistributionAmount_Leave()";
            try
            {
                // check data
                if (txtDistributionAmount.Value.ToString().Trim() != string.Empty)
                {
                    try
                    {
                        decimal decDisAmount = decimal.Parse(txtDistributionAmount.Value.ToString().Trim());
                        if (decDisAmount <= 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_DISTRIBUTE_AMOUNT_MUST_GREATER_THAN_ZERO, MessageBoxIcon.Error);
                            txtDistributionAmount.Focus();
                            txtDistributionAmount.SelectAll();
                            return;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxIcon.Error);
                        txtDistributionAmount.Focus();
                        txtDistributionAmount.SelectAll();
                        return;
                    }
                }
                FormControlComponents.OnLeaveControl(sender, e);
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       Change color of textbox
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void txtDistributionAmount_Enter(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtDistributionAmount_Enter()";
            try
            {
                FormControlComponents.OnEnterControl(sender, e);
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       Open search form for each button
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_ButtonClick(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_ButtonClick()";
            try
            {
                // if current column is locked then return
                if (dgrdData.Splits[0].DisplayColumns[dgrdData.Col].Locked)
                    return;
                FillDataToGrid();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       check if current row is locked or not
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_RowColChange(object sender, RowColChangeEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_RowColChange()";
            try
            {
                // row changed
                if (e.LastRow != dgrdData.Row)
                {
                    // get SO Detail of current row
                    int intPODetailID = 0;
                    try
                    {
                        intPODetailID = int.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.SALEORDERDETAILID_FLD].ToString());
                    }
                    catch { }
                    if (intPODetailID <= 0)
                        return;
                    voSODetail = new SaleOrderBO().GetSaleOrderDetail(intPODetailID);                    
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       before delete a row on grid, we need to store the line being deleted
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_BeforeDelete(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeDelete()";
            try
            {
                // turn of auto increment mode
                dstData.Tables[0].Columns[LINE_COL].AutoIncrement = false;
                // get deleted line number
                try
                {
                    intDeletedLine = int.Parse(dgrdData[dgrdData.Row, LINE_COL].ToString());
                }
                catch { }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       after delete a row on grid, we need to update amount
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void dgrdData_AfterDelete(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterDelete()";
            try
            {
                // allow user to add new
                dgrdData.AllowAddNew = true;
                if (dgrdData.RowCount < 1)
                    return;
                // re-assign line value
                int intCount = 0;
                for (int i = 0; i < dgrdData.RowCount; i++)
                {
                    dgrdData[i, LINE_COL] = ++intCount;
                }
                // update total amount when user delete one line on grid
                UpdateTotalAmount();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       Close the form
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void SOAdditionCharges_Closing(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".SOAdditionCharges_Closing()";
            try
            {
                if (this.mEnumAction != EnumAction.Default)
                {
                    DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    switch (dlgResult)
                    {
                        case DialogResult.Yes:
                            if (!SaveData())
                            {
                                e.Cancel = true;
                            }
                            break;
                        case DialogResult.No:
                            e.Cancel = false;
                            break;
                        case DialogResult.Cancel:
                            e.Cancel = true;
                            break;
                    }
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        #endregion

        #region private methods

        //**************************************************************************              
        ///    <Description>
        ///     Bind data to true db grid
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void BindDataToGrid()
        {
            try
            {
                #region store all columns header for localized purpose

                string strLineHeader = dgrdData.Columns[LINE_COL].Caption;
                int intLineWidth = dgrdData.Splits[0].DisplayColumns[LINE_COL].Width;
                string strSOLineHeader = dgrdData.Columns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Caption;
                int intSOLineWidth = dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Width;
                string strAddChargeHeader = dgrdData.Columns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Caption;
                string strReasonHeader = dgrdData.Columns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Caption;
                string strQuantityHeader = dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD].Caption;
                string strUnitPriceHeader = dgrdData.Columns[SO_AdditionChargeTable.UNITPRICE_FLD].Caption;
                string strAmountHeader = dgrdData.Columns[SO_AdditionChargeTable.AMOUNT_FLD].Caption;
                string strVATAmountHeader = dgrdData.Columns[SO_AdditionChargeTable.VATAMOUNT_FLD].Caption;
                string strTotalAmountHeader = dgrdData.Columns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].Caption;

                #endregion

                dgrdData.DataSource = dstData.Tables[0];

                #region restore columns header

                foreach (C1DisplayColumn objCol in dgrdData.Splits[0].DisplayColumns)
                {
                    objCol.Visible = false;
                    objCol.Locked = true;
                    objCol.AutoSize();
                    objCol.HeadingStyle.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;
                }
                //
                // Line
                //
                dgrdData.Splits[0].DisplayColumns[LINE_COL].Visible = true;
                dgrdData.Splits[0].DisplayColumns[LINE_COL].Width = intLineWidth;
                dgrdData.Columns[LINE_COL].Caption = strLineHeader;
                //
                // SO Line
                //
                dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Width = intSOLineWidth;
                dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Locked = false;
                dgrdData.Columns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Caption = strSOLineHeader;
                dgrdData.Columns[SO_SaleOrderDetailTable.SALEORDERLINE_FLD].Editor = txtCellValue;
                //
                // Addition Charge
                //
                dgrdData.Splits[0].DisplayColumns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                dgrdData.Splits[0].DisplayColumns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Locked = false;
                dgrdData.Columns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Caption = strAddChargeHeader;
                dgrdData.Columns[MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD].Editor = txtCellValue;
                //
                // Reason
                //
                dgrdData.Splits[0].DisplayColumns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Locked = false;
                dgrdData.Columns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Caption = strReasonHeader;
                dgrdData.Columns[MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD].Editor = txtCellValue;
                //
                // Quantity
                //
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.QUANTITY_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.QUANTITY_FLD].Locked = false;
                dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD].Caption = strQuantityHeader;
                dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD].Editor = txtCellValue;
                dgrdData.Columns[SO_AdditionChargeTable.QUANTITY_FLD].NumberFormat = Constants.CELL_NUMBER_FORMAT;
                //
                // UnitPrice
                //
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.UNITPRICE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.UNITPRICE_FLD].Locked = false;
                dgrdData.Columns[SO_AdditionChargeTable.UNITPRICE_FLD].Caption = strUnitPriceHeader;
                dgrdData.Columns[SO_AdditionChargeTable.UNITPRICE_FLD].Editor = txtCellValue;
                dgrdData.Columns[SO_AdditionChargeTable.UNITPRICE_FLD].NumberFormat = Constants.CELL_NUMBER_FORMAT;
                //
                // Amount
                //
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.AMOUNT_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.AMOUNT_FLD].Locked = false;
                dgrdData.Columns[SO_AdditionChargeTable.AMOUNT_FLD].Caption = strAmountHeader;
                dgrdData.Columns[SO_AdditionChargeTable.AMOUNT_FLD].Editor = txtCellValue;
                dgrdData.Columns[SO_AdditionChargeTable.AMOUNT_FLD].NumberFormat = Constants.CELL_NUMBER_FORMAT;
                //
                // VAT Amount
                //
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.VATAMOUNT_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.VATAMOUNT_FLD].Locked = false;
                dgrdData.Columns[SO_AdditionChargeTable.VATAMOUNT_FLD].Caption = strVATAmountHeader;
                dgrdData.Columns[SO_AdditionChargeTable.VATAMOUNT_FLD].Editor = txtCellValue;
                dgrdData.Columns[SO_AdditionChargeTable.VATAMOUNT_FLD].NumberFormat = Constants.CELL_NUMBER_FORMAT;
                //
                // Total Amount
                //
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].Locked = false;
                dgrdData.Columns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].Caption = strTotalAmountHeader;
                dgrdData.Columns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].Editor = txtCellValue;
                dgrdData.Columns[SO_AdditionChargeTable.TOTALAMOUNT_FLD].NumberFormat = Constants.CELL_NUMBER_FORMAT;
                #endregion

                // if total row have data of grid equal to number of sale order detail
                // then disable add new record to grid
                int intTotalRowHaveData = dgrdData.RowCount;
                int intTotalSODetail = tblSODetail.Rows.Count;
                if (intTotalRowHaveData == intTotalSODetail)
                {
                    dgrdData.AllowAddNew = false;
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     This method uses to calculate Total Amount
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private decimal CalculateTotalAmount()
        {
            try
            {
                // get rows count of grid
                int intRowsCount = dgrdData.RowCount;
                decimal decTotalValue = 0;

                // calculate value
                for (int i = 0; i < intRowsCount; i++)
                {
                    try
                    {
                        decTotalValue += decimal.Parse(dgrdData[i, SO_AdditionChargeTable.TOTALAMOUNT_FLD].ToString());
                    }
                    catch
                    {
                    }
                }
                return decTotalValue;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     This method uses to calculate Total VAT Amount
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private decimal CalculateTotalVATAmount()
        {
            try
            {
                // get rows count of grid
                int intRowsCount = dgrdData.RowCount;
                decimal decTotalValue = 0;

                // calculate value
                for (int i = 0; i < intRowsCount; i++)
                {
                    try
                    {
                        decTotalValue += decimal.Parse(dgrdData[i, SO_AdditionChargeTable.VATAMOUNT_FLD].ToString());
                    }
                    catch
                    {
                    }
                }
                return decTotalValue;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     This method uses to calculate Total NET Amount
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private decimal CalculateTotalNETAmount()
        {
            try
            {
                // get rows count of grid
                int intRowsCount = dgrdData.RowCount;
                decimal decTotalValue = 0;

                // calculate value
                for (int i = 0; i < intRowsCount; i++)
                {
                    try
                    {
                        decTotalValue += decimal.Parse(dgrdData[i, SO_AdditionChargeTable.AMOUNT_FLD].ToString());
                    }
                    catch
                    {
                    }
                }
                return decTotalValue;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     This method uses to update total amount (NET, VAT, Amount)
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void UpdateTotalAmount()
        {
            try
            {
                // calculate Total VAT Amount
                decimal decTotalVATAmount = CalculateTotalVATAmount();
                lblTotalVATAmount.Text = decTotalVATAmount.ToString(Constants.DECIMAL_NUMBERFORMAT);
                // calculate Total Amount
                decimal decTotalAmount = CalculateTotalAmount();
                lblTotalAmount.Text = decTotalAmount.ToString(Constants.DECIMAL_NUMBERFORMAT);
                // calculate Total NET Amount
                decimal decTotalNETAmount = CalculateTotalNETAmount();
                lblTotalNetAmount.Text = decTotalNETAmount.ToString(Constants.DECIMAL_NUMBERFORMAT);
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///     This method uses to update Amount, VATAmount, Total Amount incase of charge by manual
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///    
        ///    </Outputs>
        ///    <Returns>
        ///    
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    16-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void UpdateAmount(string pstrBy, bool blnForOneRow)
        {
            try
            {
                decimal decAmount = 0;
                decimal decQuantity = 0;
                decimal decUnitPrice = 0;
                decimal decAddChargeVAT = 0;
                decimal decVATAmount = 0;
                decimal decTotalAmount = 0;
                decimal decTotalQuantity = 0;
                decimal decTotalUniPrice = 0;
                decimal decDistributionAmount = 0;
                int intAddChargeID = 0;
                // get distribution amount
                try
                {
                    decDistributionAmount = decimal.Parse(txtDistributionAmount.Value.ToString().Trim());
                    if (decDistributionAmount <= 0)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_DISTRIBUTE_AMOUNT_MUST_GREATER_THAN_ZERO, MessageBoxIcon.Error);
                        txtDistributionAmount.Focus();
                        txtDistributionAmount.SelectAll();
                        return;
                    }
                }
                catch
                {
                }
                int intRowsCount = dgrdData.RowCount;
                // we get total quantity, total unit price
                for (int i = 0; i < intRowsCount; i++)
                {
                    // get total quantity of all rows
                    try
                    {
                        decTotalQuantity += decimal.Parse(dgrdData[i, SO_AdditionChargeTable.QUANTITY_FLD].ToString());
                    }
                    catch
                    {
                    }
                    // get total unit price of all rows
                    try
                    {
                        decTotalUniPrice += decimal.Parse(dgrdData[i, SO_AdditionChargeTable.UNITPRICE_FLD].ToString());
                    }
                    catch
                    {
                    }
                }
                if (radByPrice.Checked && decTotalUniPrice <= 0)
                    return;
                if (radByQuantity.Checked && decTotalQuantity <= 0)
                    return;
                // we have total quantity and total unit price
                // now fill value to Amount, VAT Amount, Total Amount cell of grid
                if (blnForOneRow)
                {
                    try
                    {
                        decQuantity = decimal.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.QUANTITY_FLD].ToString());
                    }
                    catch
                    {
                        decQuantity = 0;
                    }
                    try
                    {
                        decUnitPrice = decimal.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.UNITPRICE_FLD].ToString());
                    }
                    catch
                    {
                        decUnitPrice = 0;
                    }
                    switch (pstrBy)
                    {
                        case BY_PRICE:
                            // Amount = (Unit Price/Total Unit Price) * Distribution Amount)
                            decAmount = Math.Round((decUnitPrice / decTotalUniPrice) * decDistributionAmount, DECIMAL_ROUND);
                            break;
                        case BY_QUANTITY:
                            // Amount = (Quantity/Total Quantity) * Distribution Amount)
                            decAmount = Math.Round((decQuantity / decTotalQuantity) * decDistributionAmount, DECIMAL_ROUND);
                            break;
                        case BY_MANUAL:
                            // Amount = Quantity * Unit Price
                            decAmount = decQuantity * decUnitPrice;
                            break;
                    }
                    // get AddChargeID
                    try
                    {
                        intAddChargeID = int.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.ADDCHARGEID_FLD].ToString());
                    }
                    catch { }
                    if (intAddChargeID > 0)
                    {
                        // get addition charge vo
                        voAddCharge = (MST_AddChargeVO)boSOAdditionCharges.GetAddCharge(intAddChargeID);
                        decAddChargeVAT = voAddCharge.VAT;
                    }
                    // get Addition Charge VAT
                    decAddChargeVAT = decAddChargeVAT;
                    // VAT Amount =  Amount * Addition Charge VAT / 100
                    decVATAmount = Math.Round(decAmount * decAddChargeVAT / VAT_NUMBER, DECIMAL_ROUND);
                    // Total Amount = Amount + VAT Amount
                    decTotalAmount = Math.Round(decAmount + decVATAmount, DECIMAL_ROUND);
                    // fill data to cell
                    dgrdData[dgrdData.Row, SO_AdditionChargeTable.AMOUNT_FLD] = decAmount;
                    dgrdData[dgrdData.Row, SO_AdditionChargeTable.VATAMOUNT_FLD] = decVATAmount;
                    dgrdData[dgrdData.Row, SO_AdditionChargeTable.TOTALAMOUNT_FLD] = decTotalAmount;
                }
                else
                {
                    for (int i = 0; i < intRowsCount; i++)
                    {
                        try
                        {
                            decQuantity = decimal.Parse(dgrdData[i, SO_AdditionChargeTable.QUANTITY_FLD].ToString());
                        }
                        catch
                        {
                            decQuantity = 0;
                        }
                        try
                        {
                            decUnitPrice = decimal.Parse(dgrdData[i, SO_AdditionChargeTable.UNITPRICE_FLD].ToString());
                        }
                        catch
                        {
                            decUnitPrice = 0;
                        }
                        switch (pstrBy)
                        {
                            case BY_PRICE:
                                // Amount = (Unit Price/Total Unit Price) * Distribution Amount)
                                decAmount = Math.Round((decUnitPrice / decTotalUniPrice) * decDistributionAmount, DECIMAL_ROUND);
                                break;
                            case BY_QUANTITY:
                                // Amount = (Quantity/Total Quantity) * Distribution Amount)
                                decAmount = Math.Round((decQuantity / decTotalQuantity) * decDistributionAmount, DECIMAL_ROUND);
                                break;
                            case BY_MANUAL:
                                // Amount = Quantity * Unit Price
                                decAmount = decQuantity * decUnitPrice;
                                break;
                        }
                        // get AddChargeID
                        try
                        {
                            intAddChargeID = int.Parse(dgrdData[dgrdData.Row, SO_AdditionChargeTable.ADDCHARGEID_FLD].ToString());
                        }
                        catch { }
                        if (intAddChargeID > 0)
                        {
                            // get addition charge vo
                            voAddCharge = (MST_AddChargeVO)boSOAdditionCharges.GetAddCharge(intAddChargeID);
                            decAddChargeVAT = voAddCharge.VAT;
                        }
                        // get Addition Charge VAT
                        decAddChargeVAT = decAddChargeVAT;
                        // VAT Amount =  Amount * Addition Charge VAT / 100
                        decVATAmount = Math.Round(decAmount * decAddChargeVAT / VAT_NUMBER, DECIMAL_ROUND);
                        // Total Amount = Amount + VAT Amount
                        decTotalAmount = Math.Round(decAmount + decVATAmount, DECIMAL_ROUND);
                        // fill data to cell
                        dgrdData[i, SO_AdditionChargeTable.AMOUNT_FLD] = decAmount;
                        dgrdData[i, SO_AdditionChargeTable.VATAMOUNT_FLD] = decVATAmount;
                        dgrdData[i, SO_AdditionChargeTable.TOTALAMOUNT_FLD] = decTotalAmount;
                    }
                }
                // update TotalAmount, TotalVATAmount, TotalNETAmount;
                UpdateTotalAmount();
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       - Save into Database and show success message
        ///    </Description>
        ///    <Inputs>
        ///        
        ///    </Inputs>
        ///    <Outputs>
        ///			true if save successfull
        ///			false if failed
        ///    </Outputs>
        ///    <Returns>
        ///			bool
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    17-Feb-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private bool SaveData()
        {
            try
            {
                // update data source
                dgrdData.UpdateData();
                // update data base
                boSOAdditionCharges.UpdateDataSet(dstData);
                // refresh the grid
                dgrdData.Refresh();
                // turn off edit mode
                mEnumAction = EnumAction.Default;
                return true;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        //**************************************************************************              
        ///    <Description>
        ///       This method use to get row and fill data to grid
        ///       if GetRows return 0 then OpenSearchForm(false)
        ///       else if GetRows return 1 then fill data to grid
        ///       else if GetRows return more than 1 record then OpenSearchForm(true)
        ///    </Description>
        ///    <Inputs>
        ///       
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       16-04-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void FillDataToGrid()
        {
            try
            {
                string strColumn = dgrdData.Columns[dgrdData.Col].DataField;
                if (!strColumn.Equals(SO_SaleOrderDetailTable.SALEORDERLINE_FLD)
                    && !strColumn.Equals(MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD)
                    && !strColumn.Equals(MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD))
                {
                    return;
                }
                string strValue = ((TextBox)dgrdData.Columns[dgrdData.Col].Editor).Text.Trim();
                DataTable tblData = new DataTable();
                string strExpression = string.Empty;
                int intRowCount = dgrdData.RowCount;
                switch (strColumn)
                {
                    // SO line
                    case SO_SaleOrderDetailTable.SALEORDERLINE_FLD:
                        // select all sale order line that not list in grid
                        // get the list of current SO Line in grid in order to filter
                        ArrayList arrLines = new ArrayList();
                        for (int i = 0; i < intRowCount; i++)
                        {
                            if ((dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD] != null) && (dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD].ToString() != string.Empty))
                            {
                                arrLines.Add(dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD].ToString());
                            }
                        }
                        arrLines.TrimToSize();
                        // ignore all po line has been approved
                        strExpression = Constants.WHERE_KEYWORD + Constants.WHITE_SPACE
                            + SO_SaleOrderDetailTable.SALEORDERMASTERID_FLD + Constants.EQUAL + voSOMaster.SaleOrderMasterID.ToString();
                        for (int i = 0; i < arrLines.Count; i++)
                        {
                            strExpression += Constants.AND + SO_SaleOrderDetailTable.SALEORDERLINE_FLD + NOT_EQUAL + arrLines[i].ToString();
                        }
                        strExpression += Constants.AND + SO_SaleOrderDetailTable.SALEORDERLINE_FLD + Constants.LIKE_OPEN + strValue + Constants.LIKE_CLOSE;
                        tblData = boUtils.GetRows(SO_SaleOrderDetailTable.TABLE_NAME, strExpression);
                        break;
                    // Addition Charge
                    case (MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD):
                        tblData = boUtils.GetRows(MST_AddChargeTable.TABLE_NAME, MST_AddChargeTable.CODE_FLD, strValue, null);
                        break;
                    // Reason
                    case (MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD):
                        tblData = boUtils.GetRows(MST_ReasonTable.TABLE_NAME, MST_ReasonTable.CODE_FLD, strValue, null);
                        break;
                }
                switch (tblData.Rows.Count)
                {
                    case 0:
                        OpenSearchForm(false);
                        break;
                    case 1:
                        switch (strColumn)
                        {
                            // SO line
                            case SO_SaleOrderDetailTable.SALEORDERLINE_FLD:
                                FillSOData(tblData.Rows[0], intRowCount);
                                break;
                            // Addition Charge
                            case (MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD):
                                FillAdditionChargeData(tblData.Rows[0]);
                                break;
                            // Reason
                            case (MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD):
                                FillReasonData(tblData.Rows[0]);
                                break;
                        }
                        break;
                    default:
                        OpenSearchForm(true);
                        break;
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       This method use to fill purchase order detail data to grid
        ///    </Description>
        ///    <Inputs>
        ///       
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       16-04-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void FillSOData(DataRow pdrowData, int pintRowCount)
        {
            try
            {
                SaleOrderBO objSaleOrderBO = new SaleOrderBO();
                // get SaleOrderDetail
                if (pdrowData[SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD] != null && pdrowData[SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD].ToString() != string.Empty)
                    voSODetail = objSaleOrderBO.GetSaleOrderDetail(Convert.ToInt32(pdrowData[SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD]));
                else
                    return;
                // set grid to EditActive mode
                dgrdData.EditActive = true;
                // line number
                int intMaxLine = 0;
                if (dgrdData[dgrdData.Row, LINE_COL].ToString() == string.Empty)
                {
                    // get max line number
                    if (dgrdData.Row > 0)
                    {
                        intMaxLine = int.Parse(dgrdData[dgrdData.Row - 1, LINE_COL].ToString());
                    }
                    dgrdData[dgrdData.Row, LINE_COL] = ++intMaxLine;
                }
                // so line
                dgrdData[dgrdData.Row, SO_SaleOrderDetailTable.SALEORDERLINE_FLD] = voSODetail.SaleOrderLine;

                // so detail id
                dgrdData[dgrdData.Row, SO_AdditionChargeTable.SALEORDERDETAILID_FLD] = voSODetail.SaleOrderDetailID;
                if (dgrdData.AllowAddNew)
                {
                    pintRowCount = dgrdData.RowCount;
                    // if total row have data of grid equal to number of sale order detail
                    // then disable add new record to grid
                    if (pintRowCount == tblSODetail.Rows.Count)
                        dgrdData.AllowAddNew = false;
                    else
                        dgrdData.AllowAddNew = true;
                }
                if (radByPrice.Checked)
                    UpdateAmount(BY_PRICE, true);
                else if (radByQuantity.Checked)
                    UpdateAmount(BY_QUANTITY, true);
                else if (radManual.Checked)
                    UpdateAmount(BY_MANUAL, true);
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       This method use to fill addition charge data to grid
        ///    </Description>
        ///    <Inputs>
        ///       
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       16-04-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void FillAdditionChargeData(DataRow pdrowData)
        {
            try
            {
                if ((pdrowData[MST_AddChargeTable.ADDCHARGEID_FLD] != null) && (pdrowData[MST_AddChargeTable.ADDCHARGEID_FLD].ToString() != string.Empty))
                {
                    voAddCharge = (MST_AddChargeVO)boSOAdditionCharges.GetAddCharge(int.Parse(pdrowData[MST_AddChargeTable.ADDCHARGEID_FLD].ToString()));
                }
                else
                    return;
                // set grid to EditActive mode
                dgrdData.EditActive = true;
                dgrdData[dgrdData.Row, MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD] = voAddCharge.Code;
                dgrdData[dgrdData.Row, PO_AdditionChargesTable.ADDCHARGEID_FLD] = voAddCharge.AddChargeID;
                // update amount on grid
                if (radByPrice.Checked)
                    UpdateAmount(BY_PRICE, true);
                else if (radByQuantity.Checked)
                    UpdateAmount(BY_QUANTITY, true);
                else if (radManual.Checked)
                    UpdateAmount(BY_MANUAL, true);
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       This method use to fill reason data to grid
        ///    </Description>
        ///    <Inputs>
        ///       
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       16-04-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void FillReasonData(DataRow pdrowData)
        {
            try
            {
                if ((pdrowData[MST_ReasonTable.REASONID_FLD] != null) && (pdrowData[MST_ReasonTable.REASONID_FLD].ToString() != string.Empty))
                    voReason = (MST_ReasonVO)boSOAdditionCharges.GetReasonVO(int.Parse(pdrowData[MST_ReasonTable.REASONID_FLD].ToString()));
                else
                    return;
                // set grid to EditActive mode
                dgrdData.EditActive = true;
                dgrdData[dgrdData.Row, MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD] = voReason.Code;
                dgrdData[dgrdData.Row, PO_AdditionChargesTable.REASONID_FLD] = voReason.ReasonID;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //**************************************************************************              
        ///    <Description>
        ///       This method use to open search form when user update/click cell of grid
        ///    </Description>
        ///    <Inputs>
        ///       
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       16-04-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void OpenSearchForm(bool pblnHasRows)
        {
            const string DOT_STR = ".";
            try
            {
                DataRowView drowData = null; // store result of OpenSearchForm
                string strExpression = string.Empty;
                // get datafield of column
                string strColumn = dgrdData.Columns[dgrdData.Col].DataField;
                string strCurrentValue = ((TextBox)dgrdData.Columns[dgrdData.Col].Editor).Text.Trim();
                int intRowCount = dgrdData.RowCount;
                switch (strColumn)
                {
                    // SO Line
                    case SO_SaleOrderDetailTable.SALEORDERLINE_FLD:
                        // select all sale order line that not list in grid
                        // get the list of current SO Line in grid in order to filter
                        ArrayList arrLines = new ArrayList();
                        for (int i = 0; i < intRowCount; i++)
                        {
                            if ((dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD] != null) && (dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD].ToString() != string.Empty))
                            {
                                arrLines.Add(dgrdData[i, SO_SaleOrderDetailTable.SALEORDERLINE_FLD].ToString());
                            }
                        }
                        arrLines.TrimToSize();
                        strExpression = Constants.WHERE_KEYWORD + Constants.WHITE_SPACE
                            + SO_SaleOrderDetailTable.TABLE_NAME + DOT_STR + SO_SaleOrderDetailTable.SALEORDERMASTERID_FLD + Constants.EQUAL + voSOMaster.SaleOrderMasterID.ToString();
                        for (int i = 0; i < arrLines.Count; i++)
                        {
                            strExpression += Constants.AND + SO_SaleOrderDetailTable.TABLE_NAME + DOT_STR + SO_SaleOrderDetailTable.SALEORDERLINE_FLD + NOT_EQUAL + arrLines[i].ToString();
                        }
                        if ((strCurrentValue != null) && (strCurrentValue.Trim() != string.Empty) && pblnHasRows)
                        {
                            strExpression += Constants.AND + SO_SaleOrderDetailTable.TABLE_NAME + DOT_STR + SO_SaleOrderDetailTable.SALEORDERLINE_FLD + Constants.LIKE_OPEN + strCurrentValue + Constants.LIKE_CLOSE;
                        }
                        drowData = FormControlComponents.OpenSearchForm(SO_SaleOrderDetailTable.TABLE_NAME, strExpression);
                        break;
                    // Addition Charge
                    case (MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD):
                        strExpression = Constants.WHERE_KEYWORD + Constants.WHITE_SPACE
                            + MST_AddChargeTable.CODE_FLD + Constants.LIKE_OPEN + strCurrentValue + Constants.LIKE_CLOSE;
                        if (pblnHasRows)
                            drowData = FormControlComponents.OpenSearchForm(MST_AddChargeTable.TABLE_NAME, strExpression);
                        else
                            drowData = FormControlComponents.OpenSearchForm(MST_AddChargeTable.TABLE_NAME, string.Empty);
                        break;
                    // Reason
                    case (MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD):
                        strExpression = Constants.WHERE_KEYWORD + Constants.WHITE_SPACE
                            + MST_ReasonTable.TABLE_NAME + DOT_STR + MST_ReasonTable.CODE_FLD + Constants.LIKE_OPEN + strCurrentValue + Constants.LIKE_CLOSE;
                        if (pblnHasRows)
                            drowData = FormControlComponents.OpenSearchForm(MST_ReasonTable.TABLE_NAME, strExpression);
                        else
                            drowData = FormControlComponents.OpenSearchForm(MST_ReasonTable.TABLE_NAME, string.Empty);
                        break;
                }
                if (drowData != null)
                {
                    switch (strColumn)
                    {
                        // SO Line
                        case SO_SaleOrderDetailTable.SALEORDERLINE_FLD:
                            FillSOData(drowData.Row, intRowCount);
                            break;
                        // Addition Charge
                        case (MST_AddChargeTable.TABLE_NAME + MST_AddChargeTable.CODE_FLD):
                            FillAdditionChargeData(drowData.Row);
                            break;
                        // Reason
                        case (MST_ReasonTable.TABLE_NAME + MST_ReasonTable.CODE_FLD):
                            FillReasonData(drowData.Row);
                            break;
                    }
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion

    }
}